From f7605fac4c83c34e89072e87a22fc9915d0e93e3 Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 8 Jan 2024 14:04:53 +0000 Subject: [PATCH 1/2] fix: return error rather instead of panicking on invalid circuit. --- acvm-repo/acvm_js/src/execute.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acvm-repo/acvm_js/src/execute.rs b/acvm-repo/acvm_js/src/execute.rs index 439a929cc98..3f691e1abf2 100644 --- a/acvm-repo/acvm_js/src/execute.rs +++ b/acvm-repo/acvm_js/src/execute.rs @@ -61,8 +61,8 @@ pub async fn execute_circuit_with_black_box_solver( foreign_call_handler: ForeignCallHandler, ) -> Result { console_error_panic_hook::set_once(); - let circuit: Circuit = - Circuit::deserialize_circuit(&circuit).expect("Failed to deserialize circuit"); + let circuit: Circuit = Circuit::deserialize_circuit(&circuit) + .map_err(|_| JsExecutionError::new("Failed to deserialize circuit. This is likely due to differing serialization formats between ACVM_JS and your compiler".to_string(), None))?; let mut acvm = ACVM::new(&solver.0, &circuit.opcodes, initial_witness.into()); From 8adcfe3464db1a813a39d41dcdf8821db7dfa1af Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 8 Jan 2024 14:07:01 +0000 Subject: [PATCH 2/2] chore: cspell --- cspell.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cspell.json b/cspell.json index c4a530b8d38..8e3f248acfa 100644 --- a/cspell.json +++ b/cspell.json @@ -11,6 +11,7 @@ "arity", "arkworks", "arraysort", + "barebones", "barretenberg", "bincode", "bindgen", @@ -82,6 +83,7 @@ "jmpif", "jmpifs", "jmps", + "jsdoc", "Jubjub", "keccak", "krate", @@ -154,8 +156,7 @@ "vecmap", "wasi", "Weierstraß", - "zshell", - "barebones" + "zshell" ], "ignorePaths": [ "./**/node_modules/**"