Skip to content

Commit

Permalink
ADD: contract ret fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
hongyuanyang-uu committed Dec 1, 2023
1 parent d5957f3 commit 7906a08
Show file tree
Hide file tree
Showing 22 changed files with 480 additions and 389 deletions.
49 changes: 27 additions & 22 deletions assembler/src/test_data_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,29 @@ mod tests {
generate_from_file("sc_input.json".to_string(), "sc_input.json".to_string());
}

// #[test]
// fn generate_sccall() {
// generate_from_file(
// "sccall/sccall_caller.json".to_string(),
// "sccall/sccall_caller.json".to_string(),
// );
// generate_from_file(
// "sccall/sccall_callee.json".to_string(),
// "sccall/sccall_callee.json".to_string(),
// );
// }
#[test]
fn generate_sccall() {
generate_from_file(
"sccall/sccall_caller.json".to_string(),
"sccall/sccall_caller.json".to_string(),
);
generate_from_file(
"sccall/sccall_callee.json".to_string(),
"sccall/sccall_callee.json".to_string(),
);
}

// #[test]
// fn generate_sccall_test() {
// generate_from_file(
// "sccall/caller.json".to_string(),
// "sccall/caller.json".to_string(),
// );
// generate_from_file(
// "sccall/callee.json".to_string(),
// "sccall/callee.json".to_string(),
// );
// }
#[test]
fn generate_sccall_test() {
generate_from_file(
"sccall/caller.json".to_string(),
"sccall/caller.json".to_string(),
);
generate_from_file(
"sccall/callee.json".to_string(),
"sccall/callee.json".to_string(),
);
}

#[test]
fn generate_store_u32() {
Expand Down Expand Up @@ -194,6 +194,11 @@ mod tests {
"sqrt_prophet_asm.json".to_string(),
);
}

#[test]
fn generate_ptr_call() {
generate_from_file("ptr_call.json".to_string(), "ptr_call.json".to_string());
}
fn generate_from_file(input_file_name: String, output_file_name: String) {
let _ = fs::create_dir_all("test_data/bin");
let input_path = format!("test_data/asm/{}", input_file_name);
Expand Down
86 changes: 79 additions & 7 deletions assembler/test_data/asm/sccall/sccall_callee.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,60 @@
{
"program": "memcpy:\n.LBL15_0:\n add r9 r9 4\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mov r4 0\n mstore [r9,-1] r4\n jmp .LBL15_1\n.LBL15_1:\n mload r4 [r9,-1]\n gte r5 r3 r4\n neq r6 r4 r3\n and r5 r5 r6\n cjmp r5 .LBL15_2\n jmp .LBL15_3\n.LBL15_2:\n mload r6 [r1,r4]\n mstore [r2,r4] r6\n add r5 r4 1\n mstore [r9,-1] r5\n jmp .LBL15_1\n.LBL15_3:\n add r9 r9 -4\n ret\nmemcmp:\n.LBL16_0:\n add r9 r9 5\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mov r4 0\n mstore [r9,-1] r4\n jmp .LBL16_1\n.LBL16_1:\n mload r4 [r9,-1]\n gte r5 r3 r4\n neq r6 r4 r3\n and r5 r5 r6\n cjmp r5 .LBL16_2\n jmp .LBL16_3\n.LBL16_2:\n mload r6 [r1,r4]\n mload r7 [r2,r4]\n mstore [r9,-5] r7\n mload r7 [r9,-5]\n eq r6 r6 r7\n cjmp r6 .LBL16_2\n jmp .LBL16_4\n add r5 r4 1\n mstore [r9,-1] r5\n jmp .LBL16_1\n.LBL16_3:\n add r9 r9 -5\n ret\n.LBL16_4:\n mov r0 0\n add r9 r9 -5\n ret\nsetVars:\n.LBL17_0:\n add r9 r9 1\n mstore [r9,-1] r1\n mload r4 [r9,-1]\n mov r1 4\n.PROPHET17_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 4\n add r7 r7 1\n add r2 r1 r7\n mov r1 0\n mstore [r2] r1\n mov r1 0\n mstore [r2,+1] r1\n mov r1 0\n mstore [r2,+2] r1\n mov r1 0\n mstore [r2,+3] r1\n mov r1 4\n.PROPHET17_1:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 4\n add r7 r7 1\n add r3 r1 r7\n mov r1 r3\n mstore [r1] r4\n mov r3 0\n mstore [r1,+1] r3\n mov r3 0\n mstore [r1,+2] r3\n mov r3 0\n mstore [r1,+3] r3\n sstore r2 r1\n add r9 r9 -1\n ret\nadd:\n.LBL18_0:\n add r9 r9 2\n mstore [r9,-2] r1\n mstore [r9,-1] r2\n mload r1 [r9,-2]\n mload r2 [r9,-1]\n add r0 r1 r2\n range r0\n add r9 r9 -2\n ret\nfunction_dispatch:\n.LBL19_0:\n add r9 r9 4\n mstore [r9,-2] r9\n mov r4 r1\n mov r1 r2\n mov r1 r3\n mstore [r9,-3] r1\n mload r1 [r9,-3]\n eq r1 r4 2371037854\n cjmp r1 .LBL19_2\n eq r1 r4 2062500454\n cjmp r1 .LBL19_3\n jmp .LBL19_1\n.LBL19_1:\n ret\n.LBL19_2:\n mload r1 [r1]\n call setVars\n add r9 r9 -4\n ret\n.LBL19_3:\n mov r3 r1\n mload r3 [r3]\n add r2 r1 1\n mov r1 r2\n mload r2 [r1]\n mov r1 r3\n call add\n mov r2 r0\n mov r1 2\n.PROPHET19_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 2\n add r7 r7 1\n add r1 r1 r7\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r1] r2\n mov r2 1\n mstore [r1,+1] r2\n mload r1 [r9,-4]\n tstore r1 2\n add r9 r9 -4\n ret\nmain:\n.LBL20_0:\n add r9 r9 2\n mstore [r9,-2] r9\n mov r1 13\n.PROPHET20_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mov r6 1\n not r7 13\n add r7 r7 1\n add r2 r1 r7\n tload r2 r6 13\n mov r1 r2\n mload r6 [r1]\n mov r1 14\n.PROPHET20_1:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mov r2 1\n not r7 14\n add r7 r7 1\n add r3 r1 r7\n tload r3 r2 14\n mov r1 r3\n mload r2 [r1]\n add r4 r2 14\n mov r1 r4\n.PROPHET20_2:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mov r3 1\n not r7 r4\n add r7 r7 1\n add r5 r1 r7\n tload r5 r3 r4\n mov r3 r5\n mov r1 r6\n call function_dispatch\n add r9 r9 -2\n end\n",
"program": "memcpy:\n.LBL15_0:\n add r9 r9 4\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mov r4 0\n mstore [r9,-1] r4\n jmp .LBL15_1\n.LBL15_1:\n mload r4 [r9,-1]\n gte r5 r3 r4\n neq r6 r4 r3\n and r5 r5 r6\n cjmp r5 .LBL15_2\n jmp .LBL15_3\n.LBL15_2:\n mload r6 [r1,r4]\n mstore [r2,r4] r6\n add r5 r4 1\n mstore [r9,-1] r5\n jmp .LBL15_1\n.LBL15_3:\n add r9 r9 -4\n ret\nmemcmp_eq:\n.LBL16_0:\n add r9 r9 5\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mov r4 0\n mstore [r9,-1] r4\n jmp .LBL16_1\n.LBL16_1:\n mload r4 [r9,-1]\n gte r5 r3 r4\n neq r6 r4 r3\n and r5 r5 r6\n cjmp r5 .LBL16_2\n mov r0 1\n jmp .LBL16_3\n.LBL16_2:\n mload r6 [r1,r4]\n mload r7 [r2,r4]\n mstore [r9,-5] r7\n add r5 r4 1\n mstore [r9,-1] r5\n mload r4 [r9,-5]\n eq r4 r6 r4\n cjmp r4 .LBL16_1\n mov r0 0\n jmp .LBL16_3\n.LBL16_3:\n add r9 r9 -5\n ret\nmemcmp_ugt:\n.LBL17_0:\n add r9 r9 5\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mov r4 0\n mstore [r9,-1] r4\n jmp .LBL17_1\n.LBL17_1:\n mload r4 [r9,-1]\n gte r5 r3 r4\n neq r6 r4 r3\n and r5 r5 r6\n cjmp r5 .LBL17_2\n mov r0 1\n jmp .LBL17_3\n.LBL17_2:\n mload r6 [r1,r4]\n mload r7 [r2,r4]\n mstore [r9,-5] r7\n add r5 r4 1\n mstore [r9,-1] r5\n mload r4 [r9,-5]\n gte r4 r6 r4\n mload r5 [r9,-5]\n neq r5 r6 r5\n and r4 r4 r5\n cjmp r4 .LBL17_1\n mov r0 0\n jmp .LBL17_3\n.LBL17_3:\n add r9 r9 -5\n ret\nmemcmp_uge:\n.LBL18_0:\n add r9 r9 5\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mov r4 0\n mstore [r9,-1] r4\n jmp .LBL18_1\n.LBL18_1:\n mload r4 [r9,-1]\n gte r5 r3 r4\n neq r6 r4 r3\n and r5 r5 r6\n cjmp r5 .LBL18_2\n mov r0 1\n jmp .LBL18_3\n.LBL18_2:\n mload r6 [r1,r4]\n mload r7 [r2,r4]\n mstore [r9,-5] r7\n add r5 r4 1\n mstore [r9,-1] r5\n mload r4 [r9,-5]\n gte r4 r6 r4\n cjmp r4 .LBL18_1\n mov r0 0\n jmp .LBL18_3\n.LBL18_3:\n add r9 r9 -5\n ret\nu32_div_mod:\n.LBL19_0:\n add r9 r9 9\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mstore [r9,-7] r1\n mstore [r9,-3] r2\n mload r1 [r9,-3]\n mstore [r9,-8] r1\n mstore [r9,-2] r3\n mload r3 [r9,-2]\n mstore [r9,-1] r4\n mload r4 [r9,-1]\n mload r1 [r9,-8]\n mov r2 r1\n mload r1 [r9,-7]\n.PROPHET19_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mstore [r9,-9] r1\n mload r1 [r9,-9]\n range r1\n mload r1 [r9,-9]\n add r5 r1 1\n not r7 r5\n add r7 r7 1\n mload r1 [r9,-8]\n add r6 r1 r7\n range r6\n mload r1 [r9,-8]\n mov r2 r1\n mload r1 [r9,-7]\n.PROPHET19_1:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n range r3\n mload r2 [r9,-8]\n mul r2 r1 r2\n mstore [r9,-5] r2\n mload r2 [r9,-5]\n mload r5 [r9,-9]\n add r2 r2 r5\n mstore [r9,-6] r2\n mload r2 [r9,-6]\n mload r5 [r9,-7]\n eq r2 r2 r5\n assert r2\n mstore [r3] r1\n mload r1 [r9,-9]\n mstore [r4] r1\n add r9 r9 -9\n ret\nu32_power:\n.LBL20_0:\n add r9 r9 2\n mstore [r9,-2] r1\n mload r1 [r9,-2]\n mstore [r9,-1] r2\n mload r2 [r9,-1]\n mov r0 1\n mov r3 0\n jmp .LBL20_1\n.LBL20_1:\n add r5 r3 1\n mul r4 r0 r1\n gte r3 r2 r5\n cjmp r3 .LBL20_1\n mov r0 r4\n mov r3 r5\n jmp .LBL20_2\n.LBL20_2:\n range r0\n add r9 r9 -2\n ret\nsetVars:\n.LBL21_0:\n add r9 r9 1\n mstore [r9,-1] r1\n mload r4 [r9,-1]\n mov r1 4\n.PROPHET21_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 4\n add r7 r7 1\n add r2 r1 r7\n mov r1 0\n mstore [r2] r1\n mov r1 0\n mstore [r2,+1] r1\n mov r1 0\n mstore [r2,+2] r1\n mov r1 0\n mstore [r2,+3] r1\n mov r1 4\n.PROPHET21_1:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 4\n add r7 r7 1\n add r3 r1 r7\n mov r1 r3\n mstore [r1] r4\n mov r3 0\n mstore [r1,+1] r3\n mov r3 0\n mstore [r1,+2] r3\n mov r3 0\n mstore [r1,+3] r3\n sstore r2 r1\n add r9 r9 -1\n ret\nadd:\n.LBL22_0:\n add r9 r9 2\n mstore [r9,-2] r1\n mstore [r9,-1] r2\n mload r1 [r9,-2]\n mload r2 [r9,-1]\n add r0 r1 r2\n range r0\n add r9 r9 -2\n ret\nfunction_dispatch:\n.LBL23_0:\n add r9 r9 5\n mstore [r9,-2] r9\n mov r2 r3\n mstore [r9,-3] r2\n mload r2 [r9,-3]\n eq r8 r1 2371037854\n cjmp r8 .LBL23_2\n eq r8 r1 2062500454\n cjmp r8 .LBL23_3\n jmp .LBL23_1\n.LBL23_1:\n ret\n.LBL23_2:\n mov r1 r2\n mload r1 [r1]\n call setVars\n mov r1 1\n.PROPHET23_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 1\n add r7 r7 1\n add r1 r1 r7\n mstore [r9,-4] r1\n mload r1 [r9,-4]\n mov r2 0\n mstore [r1] r2\n mload r1 [r9,-4]\n tstore r1 1\n add r9 r9 -5\n ret\n.LBL23_3:\n mov r3 r2\n mload r3 [r3]\n add r1 r2 1\n mload r2 [r1]\n mov r1 r3\n call add\n mov r2 r0\n mov r1 2\n.PROPHET23_1:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n not r7 2\n add r7 r7 1\n add r1 r1 r7\n mstore [r9,-5] r1\n mload r1 [r9,-5]\n mstore [r1] r2\n mov r2 1\n mstore [r1,+1] r2\n mload r1 [r9,-5]\n tstore r1 2\n add r9 r9 -5\n ret\nmain:\n.LBL24_0:\n add r9 r9 2\n mstore [r9,-2] r9\n mov r1 13\n.PROPHET24_0:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mov r6 1\n not r7 13\n add r7 r7 1\n add r2 r1 r7\n tload r2 r6 13\n mov r1 r2\n mload r6 [r1]\n mov r1 14\n.PROPHET24_1:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mov r2 1\n not r7 14\n add r7 r7 1\n add r3 r1 r7\n tload r3 r2 14\n mov r1 r3\n mload r2 [r1]\n add r4 r2 14\n mov r1 r4\n.PROPHET24_2:\n mov r0 psp\n mload r0 [r0]\n mov r1 r0\n mov r3 1\n not r7 r4\n add r7 r7 1\n add r5 r1 r7\n tload r5 r3 r4\n mov r3 r5\n mov r1 r6\n call function_dispatch\n add r9 r9 -2\n end\n",
"prophets": [
{
"label": ".PROPHET17_0",
"label": ".PROPHET19_0",
"code": "%{\n function mod(felt x, felt y) -> felt {\n return x % y;\n }\n entry() {\n cid.r = mod(cid.x, cid.y);\n }\n%}",
"inputs": [
{
"name": "cid.x",
"length": 1,
"is_ref": false,
"is_input_output": false
},
{
"name": "cid.y",
"length": 1,
"is_ref": false,
"is_input_output": false
}
],
"outputs": [
{
"name": "cid.r",
"length": 1,
"is_ref": false,
"is_input_output": false
}
]
},
{
"label": ".PROPHET19_1",
"code": "%{\n function div(felt x, felt y) -> felt {\n return x / y;\n }\n entry() {\n cid.q = div(cid.x, cid.y);\n }\n%}",
"inputs": [
{
"name": "cid.x",
"length": 1,
"is_ref": false,
"is_input_output": false
},
{
"name": "cid.y",
"length": 1,
"is_ref": false,
"is_input_output": false
}
],
"outputs": [
{
"name": "cid.q",
"length": 1,
"is_ref": false,
"is_input_output": false
}
]
},
{
"label": ".PROPHET21_0",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
Expand All @@ -22,7 +74,7 @@
]
},
{
"label": ".PROPHET17_1",
"label": ".PROPHET21_1",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
Expand All @@ -42,7 +94,27 @@
]
},
{
"label": ".PROPHET19_0",
"label": ".PROPHET23_0",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
"name": "cid.len",
"length": 1,
"is_ref": false,
"is_input_output": false
}
],
"outputs": [
{
"name": "cid.addr",
"length": 1,
"is_ref": false,
"is_input_output": false
}
]
},
{
"label": ".PROPHET23_1",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
Expand All @@ -62,7 +134,7 @@
]
},
{
"label": ".PROPHET20_0",
"label": ".PROPHET24_0",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
Expand All @@ -82,7 +154,7 @@
]
},
{
"label": ".PROPHET20_1",
"label": ".PROPHET24_1",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
Expand All @@ -102,7 +174,7 @@
]
},
{
"label": ".PROPHET20_2",
"label": ".PROPHET24_2",
"code": "%{\n entry() {\n cid.addr = malloc(cid.len);\n }\n%}",
"inputs": [
{
Expand Down
6 changes: 1 addition & 5 deletions circuits/benches/fibo_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ pub fn test_by_asm_json(path: String) {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: program.debug_info,
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
7 changes: 1 addition & 6 deletions circuits/benches/sqrt_prophet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ pub fn test_by_asm_json(path: String) {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: program.debug_info,
};

let mut program: Program = Program::default();
for inst in instructions {
program.instructions.push(inst.to_string());
}
Expand Down
6 changes: 1 addition & 5 deletions circuits/src/builtins/bitwise/bitwise_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,7 @@ mod tests {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: Default::default(),
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
6 changes: 1 addition & 5 deletions circuits/src/builtins/rangecheck/rangecheck_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,7 @@ mod tests {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: Default::default(),
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
6 changes: 1 addition & 5 deletions circuits/src/generation/ctl_test/debug_trace_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ pub fn get_exec_trace(
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: program.debug_info,
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
6 changes: 1 addition & 5 deletions circuits/src/program/program_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@ mod tests {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: program.debug_info,
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
6 changes: 1 addition & 5 deletions circuits/src/stark/ola_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,7 @@ mod tests {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: program.debug_info,
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
6 changes: 1 addition & 5 deletions circuits/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ pub fn test_stark_with_asm_path<Row, const COL_NUM: usize, E, H>(
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: program.debug_info,
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down
7 changes: 2 additions & 5 deletions client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ fn main() {
prophets.insert(item.host as u64, item);
}

let mut program: Program = Program {
instructions: Vec::new(),
trace: Default::default(),
debug_info: BTreeMap::new(),
};
let mut program: Program = Program::default();

for inst in instructions {
program.instructions.push(inst.to_string());
Expand Down Expand Up @@ -188,6 +184,7 @@ fn main() {
instructions: trace.raw_binary_instructions.clone(),
trace,
debug_info: BTreeMap::new(),
pre_exe_flag: false,
};

let inputs = GenerationInputs::default();
Expand Down
3 changes: 0 additions & 3 deletions core/src/crypto/poseidon_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ pub fn calculate_arbitrary_poseidon_and_generate_intermediate_trace(
}
#[cfg(test)]
mod test {




#[test]
fn test_poseidon() {
Expand Down
17 changes: 2 additions & 15 deletions core/src/merkle_tree/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::iter_ext::IteratorExt;
use super::TreeError;
use crate::crypto::hash::Hasher;

use crate::trace::trace::{PoseidonRow, HashTrace};
use crate::trace::trace::{HashTrace, PoseidonRow};
use crate::types::merkle_tree::constant::ROOT_TREE_DEPTH;
use crate::types::merkle_tree::{
tree_key_to_u256, u256_to_tree_key, NodeEntry, TreeKey, TreeKeyU256, TreeValue,
Expand Down Expand Up @@ -110,20 +110,7 @@ impl UpdatesBatch {
pub fn calculate<H>(
self,
hasher: H,
) -> Result<
(
TreePatch,
Arc<
Mutex<
Vec<(
usize,
HashTrace,
)>,
>,
>,
),
TreeError,
>
) -> Result<(TreePatch, Arc<Mutex<Vec<(usize, HashTrace)>>>), TreeError>
where
H: Hasher<TreeValue> + Send + Sync,
{
Expand Down
Loading

0 comments on commit 7906a08

Please sign in to comment.