zBlock-2 / summa-solvency-Turing

Apache License 2.0
0 stars 0 forks source link

Use of unwrap in core files and improper error handling #4

Closed sachindkagrawal15 closed 4 months ago

sachindkagrawal15 commented 7 months ago

Unwrap is usually a shortcut to bypass implementing proper error handling in Rust. Using Unwrap in production code can be dangerous and should be avoided as it crashes the application & hides actual bugs. So, This is highly undesirable in core files and is a Rust bad practice and proper error handling/transmission should be implemented.

Some of Core files in repo where unwrap is used: 1) zk_prover/src/chips/range/range_check.rs 2) zk_prover/src/circuits/merkle_sum_tree.rs 3) zk_prover/src/merkle_sum_tree/node.rs 4) zk_prover/src/merkle_sum_tree/utils/build_tree.rs 5) zk_prover/src/merkle_sum_tree/utils/csv_parser.rs 6) zk_prover/src/merkle_sum_tree/utils/operation_helpers.rs 7) zk_prover/benches/full_solvency_flow.rs 8) backend/src/apis/mod.rs 9) backend/src/apis/round.rs 10) backend/src/contracts/signer.rs