diff --git a/risc0-selective-privacy-poc/core/src/lib.rs b/risc0-selective-privacy-poc/core/src/lib.rs index 85b6b1f..9342094 100644 --- a/risc0-selective-privacy-poc/core/src/lib.rs +++ b/risc0-selective-privacy-poc/core/src/lib.rs @@ -56,7 +56,7 @@ pub fn bytes_to_words(bytes: &[u8; 32]) -> [u32; 8] { /// Verifies that a program public execution didn't break the chain's rules. /// `input_accounts` are the accounts provided as inputs to the program. /// `output_accounts` are the accounts post states after execution of the program -pub fn inputs_outputs_preserve_invariants( +pub fn post_execution_consistency_checks( input_accounts: &[Account], output_accounts: &[Account], program_id: ProgramId, diff --git a/risc0-selective-privacy-poc/examples/mocked_components/sequencer/process_public_execution.rs b/risc0-selective-privacy-poc/examples/mocked_components/sequencer/process_public_execution.rs index 7a67911..b41b1b2 100644 --- a/risc0-selective-privacy-poc/examples/mocked_components/sequencer/process_public_execution.rs +++ b/risc0-selective-privacy-poc/examples/mocked_components/sequencer/process_public_execution.rs @@ -1,4 +1,4 @@ -use core::{account::Account, inputs_outputs_preserve_invariants, types::Address}; +use core::{account::Account, post_execution_consistency_checks, types::Address}; use crate::mocked_components::sequencer::error::Error; @@ -22,7 +22,7 @@ impl MockedSequencer { nssa::execute_onchain::
(&input_accounts, instruction_data).map_err(|_| Error::BadInput)?; // Assert accounts pre- and post-states preserve chains invariants - if !inputs_outputs_preserve_invariants(&input_accounts, &program_output.accounts_post, P::PROGRAM_ID) { + if !post_execution_consistency_checks(&input_accounts, &program_output.accounts_post, P::PROGRAM_ID) { return Err(Error::BadInput); } diff --git a/risc0-selective-privacy-poc/program_methods/guest/src/bin/outer.rs b/risc0-selective-privacy-poc/program_methods/guest/src/bin/outer.rs index 7c877f7..c95726c 100644 --- a/risc0-selective-privacy-poc/program_methods/guest/src/bin/outer.rs +++ b/risc0-selective-privacy-poc/program_methods/guest/src/bin/outer.rs @@ -1,5 +1,5 @@ use core::{ - compute_nullifier, hash, inputs_outputs_preserve_invariants, is_in_tree, + compute_nullifier, hash, is_in_tree, post_execution_consistency_checks, types::{Nonce, PrivacyExecutionOutput, ProgramId, ProgramOutput}, visibility::AccountVisibility, }; @@ -52,7 +52,7 @@ fn main() { env::verify(program_id, &to_vec(&inner_program_output).unwrap()).unwrap(); // Assert accounts pre- and post-states preserve chains invariants - assert!(inputs_outputs_preserve_invariants( + assert!(post_execution_consistency_checks( &inner_program_output.accounts_pre, &inner_program_output.accounts_post, program_id