We now use the same code in the circuit and server.
We now precheck transactions before attempting to include them in a batch.
We now rely on the security of sha(public_key) instead of also checking the public key matches the one used to create an account. This made the circuit a bit more efficient (see 3526834d695b8842d142422d5efd3f869f275a17).
Profiling
Our circuit is already pretty optimized unfortunately.
60% of cycles are spent calculating the merkle root, 30% on deserializing the data into risc0.
Maybe we can use the older risc0 custom sterilization instead of serde.
I can align the data a bit better, maybe I can optimize calc_subtree_hash a bit, but not much.
Merge https://github.com/cspr-rad/kairos/pull/94 before this PR.
Changes
We now use the same code in the circuit and server. We now precheck transactions before attempting to include them in a batch. We now rely on the security of sha(public_key) instead of also checking the public key matches the one used to create an account. This made the circuit a bit more efficient (see 3526834d695b8842d142422d5efd3f869f275a17).
Profiling
Our circuit is already pretty optimized unfortunately.
60% of cycles are spent calculating the merkle root, 30% on deserializing the data into risc0. Maybe we can use the older risc0 custom sterilization instead of serde. I can align the data a bit better, maybe I can optimize
calc_subtree_hash
a bit, but not much.