add missing check on pre_states for privacy tail calls

This commit is contained in:
Sergio Chouhy 2025-12-10 23:06:35 -03:00
parent d7f0346671
commit 1b2962fa03
2 changed files with 9 additions and 4 deletions

View File

@ -25,8 +25,8 @@ pub struct Account {
pub nonce: Nonce,
}
#[derive(Serialize, Deserialize, Clone)]
#[cfg_attr(any(feature = "host", test), derive(Debug, PartialEq, Eq))]
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq)]
#[cfg_attr(any(feature = "host", test), derive(Debug))]
pub struct AccountWithMetadata {
pub account: Account,
pub is_authorized: bool,

View File

@ -45,14 +45,19 @@ fn main() {
}
// TODO: Modify when multi-chain calls are supported in the circuit
let Some(chained_call) = &caller.chained_calls.first() else {
let Some(caller_chained_call) = &caller.chained_calls.first() else {
panic!("Expected chained call");
};
// Check that instruction data in caller is the instruction data in callee
if chained_call.instruction_data != callee.instruction_data {
if caller_chained_call.instruction_data != callee.instruction_data {
panic!("Invalid instruction data");
}
// Check that account pre_states in caller are the ones in calle
if caller_chained_call.pre_states != callee.pre_states {
panic!("Invalid pre states");
}
}
for (i, program_output) in program_outputs.iter().enumerate() {