maci
maci copied to clipboard
currentSbCommitment mismatch for different stateTreeDepth
If we change the stateTreeDepth from 10 to 2, proveOnChain will fail with "currentSbCommitment mismatch" error. Here is the code to modify:
# contracts/contracts/MACI.sol
uint8 public override stateTreeDepth = 10 => uint8 public override stateTreeDepth = 2;
# core/ts/MaciState.ts
const STATE_TREE_DEPTH = 10 => const STATE_TREE_DEPTH = 2
After recompile the solidity and rebuild typescript, will see this error. And everything is fine when stateTreeDepth = 10.
To reproduce the issue:
- checkout commit: smallTree
- do the following:
# recompile and generate new zkeys
cd contracts && npm run compileSol
cd core && npm run build
cd cli && ./gen_zkeys.sh
# test
./testSmallTreeDepth.sh
- error messages
proof on chain ...
Submitting proofs of message processing...
Error: currentSbCommitment mismatch.
Closing as we prove in https://github.com/privacy-scaling-explorations/maci/pull/918 that MACI works with different stateTreeDepth parameters. The empty ballot roots must change for it to work which is accomplished by running compileSol
with a param setting the stateTreeDepth
in genEmptyBallotRootsContract
.