mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-07-26 01:23:22 +00:00
refactor: warn on private-padding saturation and rename to execute_and_prove_with_padded_inputs
This commit is contained in:
parent
2ed620097b
commit
2e8a01ac95
@ -71,7 +71,7 @@ pub fn execute_and_prove(
|
||||
account_identities: Vec<InputAccountIdentity>,
|
||||
program_with_dependencies: &ProgramWithDependencies,
|
||||
) -> Result<(PrivacyPreservingCircuitOutput, Proof), LeeError> {
|
||||
execute_and_prove_with_dummy_inputs(
|
||||
execute_and_prove_with_padded_inputs(
|
||||
pre_states,
|
||||
instruction_data,
|
||||
account_identities,
|
||||
@ -80,7 +80,7 @@ pub fn execute_and_prove(
|
||||
)
|
||||
}
|
||||
|
||||
pub fn execute_and_prove_with_dummy_inputs(
|
||||
pub fn execute_and_prove_with_padded_inputs(
|
||||
pre_states: Vec<AccountWithMetadata>,
|
||||
instruction_data: InstructionData,
|
||||
account_identities: Vec<InputAccountIdentity>,
|
||||
|
||||
@ -420,6 +420,13 @@ impl AccountManager {
|
||||
.iter()
|
||||
.filter(|state| matches!(state, State::Private(_)))
|
||||
.count();
|
||||
if private_count > Self::MAX_PRIVATE_ACCOUNTS {
|
||||
log::warn!(
|
||||
"private account count {private_count} exceeds MAX_PRIVATE_ACCOUNTS ({}); \
|
||||
padding saturates and the private-input count is not hidden",
|
||||
Self::MAX_PRIVATE_ACCOUNTS
|
||||
);
|
||||
}
|
||||
self.dummy_inputs(Self::MAX_PRIVATE_ACCOUNTS.saturating_sub(private_count))
|
||||
}
|
||||
|
||||
|
||||
@ -775,7 +775,7 @@ impl WalletCore {
|
||||
|
||||
let private_account_keys = acc_manager.private_account_keys();
|
||||
let (output, proof) =
|
||||
lee::privacy_preserving_transaction::circuit::execute_and_prove_with_dummy_inputs(
|
||||
lee::privacy_preserving_transaction::circuit::execute_and_prove_with_padded_inputs(
|
||||
pre_states,
|
||||
instruction_data,
|
||||
acc_manager.account_identities(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user