Skip to content

Commit

Permalink
MOD: fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
web3Softcloud authored and Softcloud88 committed Dec 9, 2023
1 parent 328ee74 commit dcddeb3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions executor/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use crate::{GoldilocksField, MemRangeType, Process};
use core::merkle_tree::log::WitnessStorageLog;
use core::merkle_tree::tree::AccountTree;
use core::program::Program;
use core::trace::dump::{DumpMemoryRow, DumpStep, DumpTapeRow, DumpTrace};
use core::trace::trace::{MemoryTraceCell, StorageHashRow, TapeRow};
use core::types::merkle_tree::constant::ROOT_TREE_DEPTH;
use core::types::merkle_tree::{tree_key_to_u256, TreeKeyU256, TREE_VALUE_LEN};
use core::vm::error::ProcessorError;
use core::vm::memory::HP_START_ADDR;
use core::vm::memory::MEM_SPAN_SIZE;
use log::debug;
use plonky2::field::types::{Field, Field64, PrimeField64};
use core::merkle_tree::log::WitnessStorageLog;
use core::vm::memory::HP_START_ADDR;

use std::collections::HashMap;
use std::fs::File;
Expand All @@ -30,7 +30,12 @@ pub fn gen_memory_table(
let mut first_row_flag = true;
let mut first_heap_row_flag = true;

process.memory.trace.get_mut(&HP_START_ADDR).unwrap().remove(0);
process
.memory
.trace
.get_mut(&HP_START_ADDR)
.unwrap()
.remove(0);
for (field_addr, cells) in process.memory.trace.iter() {
let mut new_addr_flag = true;

Expand Down Expand Up @@ -210,7 +215,11 @@ pub fn storage_hash_table_gen(

let mut root_hashes = Vec::new();

for (chunk, log) in hash_traces.chunks(ROOT_TREE_DEPTH).enumerate().zip(storage_logs) {
for (chunk, log) in hash_traces
.chunks(ROOT_TREE_DEPTH)
.enumerate()
.zip(storage_logs)
{
let is_write = GoldilocksField::from_canonical_u64(log.storage_log.kind as u64);
let mut root_hash = [GoldilocksField::ZERO; TREE_VALUE_LEN];
root_hash.clone_from_slice(&chunk.1.last().unwrap().0.output[0..4]);
Expand Down

0 comments on commit dcddeb3

Please sign in to comment.