Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chudkowsky committed Jan 10, 2025
1 parent 2ec433b commit 408fa58
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/appchain.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ mod appchain {
self.state.initialize(state_root, block_number, block_hash);
}


#[abi(embed_v0)]
impl Appchain of IAppchain<ContractState> {
/// This function accepts two outputs due to the dynamic nature of the layout, which prevents direct verification of the snos proof.
/// To ensure the correctness of `snos_output`, we compare its hash with the corresponding hash in `program_output`,
/// which serves as a layout bridge proof.
/// This function accepts two outputs due to the dynamic nature of the layout, which
/// prevents direct verification of the snos proof.
/// To ensure the correctness of `snos_output`, we compare its hash with the corresponding
/// hash in `program_output`, which serves as a layout bridge proof.
fn update_state(
ref self: ContractState,
snos_output: Array<felt252>,
Expand All @@ -145,12 +146,14 @@ mod appchain {

let snos_output_span = snos_output.span();
let snos_output_hash = poseidon_hash_span(snos_output_span);
let snos_output_hash_in_bridge_output = program_output.at(4);
assert!(snos_output_hash == *snos_output_hash_in_bridge_output);
let snos_output_hash_in_bridge_output = program_output.at(4);
assert!(snos_output_hash == *snos_output_hash_in_bridge_output);
let output_hash = poseidon_hash_span(program_output);

let mut snos_output_iter = snos_output.into_iter();
let program_output_struct = deserialize_os_output(ref snos_output_iter); //Custom deserialization function, inspired by
let program_output_struct = deserialize_os_output(
ref snos_output_iter
); //Custom deserialization function, inspired by
//https://github.com/starkware-libs/cairo-lang/blob/8e11b8cc65ae1d0959328b1b4a40b92df8b58595/src/starkware/starknet/core/aggregator/output_parser.py

let (current_program_hash, current_config_hash): (felt252, felt252) = self
Expand Down

0 comments on commit 408fa58

Please sign in to comment.