diff --git a/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/final_layer.rs b/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/final_layer.rs index 61978c5a2..86bfc4db1 100644 --- a/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/final_layer.rs +++ b/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/final_layer.rs @@ -15,7 +15,7 @@ use crate::{ }, sha256::sha256, }, - target_to_le_bits, verify_proof, + target_to_be_bits, verify_proof, }, validators_commitment_mapper::first_level::ValidatorsCommitmentMapperFirstLevel, }; @@ -264,28 +264,28 @@ fn hash_public_inputs, const D: usize>( let block_number_bits = biguint_to_bits_target(builder, &input.execution_block_number); - let number_of_non_activated_validators_bits = target_to_le_bits( + let number_of_non_activated_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data .validator_status_stats .non_activated_count, ); - let number_of_active_validators_bits = target_to_le_bits( + let number_of_active_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data .validator_status_stats .active_count, ); - let number_of_exited_validators_bits = target_to_le_bits( + let number_of_exited_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data .validator_status_stats .exited_count, ); - let number_of_slashed_validators_bits = target_to_le_bits( + let number_of_slashed_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data diff --git a/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/first_level.rs b/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/first_level.rs index 7348caa1b..01df5b27b 100644 --- a/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/first_level.rs +++ b/beacon-light-client/plonky2/crates/circuits/src/deposit_accumulator_balance_aggregator_diva/first_level.rs @@ -112,7 +112,7 @@ impl Circuit for DepositAccumulatorBalanceAggregatorDivaFirstLevel { let validator_hash_tree_root = hash_validator_poseidon(builder, &input.validator); - let is_valid = validate_merkle_proof_poseidon( + let validator_proof_is_valid = validate_merkle_proof_poseidon( builder, &validator_hash_tree_root, &input.validators_commitment_mapper_root, @@ -120,7 +120,7 @@ impl Circuit for DepositAccumulatorBalanceAggregatorDivaFirstLevel { &input.validator_gindex, ); - builder.assert_implication(deposit_is_real, is_valid); + builder.assert_implication(deposit_is_real, validator_proof_is_valid); assert_bool_arrays_are_equal(builder, &input.validator.pubkey, &input.deposit_pubkey); @@ -129,7 +129,7 @@ impl Circuit for DepositAccumulatorBalanceAggregatorDivaFirstLevel { let balance = get_balance_from_leaf(builder, &input.balance_leaf, balance_inner_index); let balance_gindex = builder.div_biguint(&input.validator_gindex, &four); - let is_valid = validate_merkle_proof_sha256( + let balance_proof_is_valid = validate_merkle_proof_sha256( builder, &input.balance_leaf, &input.balances_root, @@ -137,7 +137,7 @@ impl Circuit for DepositAccumulatorBalanceAggregatorDivaFirstLevel { &balance_gindex, ); - builder.assert_implication(deposit_is_real, is_valid); + builder.assert_implication(deposit_is_real, balance_proof_is_valid); let (is_non_activated, is_active, is_exited) = get_validator_status( builder, diff --git a/beacon-light-client/plonky2/crates/circuits/src/deposits_accumulator_balance_aggregator/final_layer.rs b/beacon-light-client/plonky2/crates/circuits/src/deposits_accumulator_balance_aggregator/final_layer.rs index b71b272fa..a7601b236 100644 --- a/beacon-light-client/plonky2/crates/circuits/src/deposits_accumulator_balance_aggregator/final_layer.rs +++ b/beacon-light-client/plonky2/crates/circuits/src/deposits_accumulator_balance_aggregator/final_layer.rs @@ -13,7 +13,7 @@ use crate::{ merkle::{sha256::assert_merkle_proof_is_valid_const_sha256, ssz::ssz_num_to_bits}, sha256::sha256, }, - target_to_le_bits, verify_proof, + target_to_be_bits, verify_proof, }, validators_commitment_mapper::first_level::ValidatorsCommitmentMapperFirstLevel, }; @@ -256,33 +256,33 @@ fn hash_public_inputs, const D: usize>( let block_number_bits = biguint_to_bits_target(builder, &input.execution_block_number); - let deposits_count_bits = target_to_le_bits( + let deposits_count_bits = target_to_be_bits( builder, balance_aggregation_pis.accumulated_data.deposits_count, ); - let number_of_non_activated_validators_bits = target_to_le_bits( + let number_of_non_activated_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data .validator_status_stats .non_activated_count, ); - let number_of_active_validators_bits = target_to_le_bits( + let number_of_active_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data .validator_status_stats .active_count, ); - let number_of_exited_validators_bits = target_to_le_bits( + let number_of_exited_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data .validator_status_stats .exited_count, ); - let number_of_slashed_validators_bits = target_to_le_bits( + let number_of_slashed_validators_bits = target_to_be_bits( builder, balance_aggregation_pis .accumulated_data diff --git a/beacon-light-client/plonky2/crates/circuits/src/utils/circuit/mod.rs b/beacon-light-client/plonky2/crates/circuits/src/utils/circuit/mod.rs index 218d1a356..40f961184 100644 --- a/beacon-light-client/plonky2/crates/circuits/src/utils/circuit/mod.rs +++ b/beacon-light-client/plonky2/crates/circuits/src/utils/circuit/mod.rs @@ -191,7 +191,7 @@ pub fn select_biguint, const D: usize>( result } -pub fn target_to_le_bits, const D: usize>( +pub fn target_to_be_bits, const D: usize>( builder: &mut CircuitBuilder, number: Target, ) -> [BoolTarget; 64] { diff --git a/beacon-light-client/plonky2/crates/circuits/src/withdrawal_credentials_balance_aggregator/final_layer.rs b/beacon-light-client/plonky2/crates/circuits/src/withdrawal_credentials_balance_aggregator/final_layer.rs index c9cb430b5..725c7d5c1 100644 --- a/beacon-light-client/plonky2/crates/circuits/src/withdrawal_credentials_balance_aggregator/final_layer.rs +++ b/beacon-light-client/plonky2/crates/circuits/src/withdrawal_credentials_balance_aggregator/final_layer.rs @@ -11,7 +11,7 @@ use crate::{ merkle::{sha256::assert_merkle_proof_is_valid_const_sha256, ssz::ssz_num_to_bits}, sha256::sha256, }, - target_to_le_bits, verify_proof, + target_to_be_bits, verify_proof, }, validators_commitment_mapper::first_level::ValidatorsCommitmentMapperFirstLevel, withdrawal_credentials_balance_aggregator::first_level::WithdrawalCredentialsBalanceAggregatorFirstLevel, @@ -132,15 +132,15 @@ impl Circuit .cloned() .collect_vec(); - let number_of_non_activated_validators_bits = target_to_le_bits( + let number_of_non_activated_validators_bits = target_to_be_bits( builder, balance_verification_pi.number_of_non_activated_validators, ); let number_of_active_validators_bits = - target_to_le_bits(builder, balance_verification_pi.number_of_active_validators); + target_to_be_bits(builder, balance_verification_pi.number_of_active_validators); let number_of_exited_validators_bits = - target_to_le_bits(builder, balance_verification_pi.number_of_exited_validators); - let number_of_slashed_validators_bits = target_to_le_bits( + target_to_be_bits(builder, balance_verification_pi.number_of_exited_validators); + let number_of_slashed_validators_bits = target_to_be_bits( builder, balance_verification_pi.number_of_slashed_validators, );