Submitted by xuwinnie
https://github.com/code-423n4/2023-10-zksync/blob/1fb4649b612fac7b4ee613df6f6b7d921ddd6b0d/code/era-zkevm_circuits/src/main_vm/opcodes/mul_div.rs#L286-L292
https://github.com/code-423n4/2023-10-zksync/blob/1fb4649b612fac7b4ee613df6f6b7d921ddd6b0d/code/era-zkevm_circuits/src/main_vm/opcodes/mul_div.rs#L358
When applying opcode div, if dividend is nonzero and divisor is zero, the resulted quotient and remainder are both zero. The enforced mul/div relation does not hold. An unprovable transaction will dos the priority queue.
According to the EraVM spec, if divisor is zero, quotient and remainder should also be zero.
When dividing, the relation we need to enforce is src0 = q * src1 + rem. However, if src0 (dividend) is nonzero and src1 (divisor) is zero, both q and rem will be zero. The relation does not hold.
In fact, this relation will be enforced as long as we apply div, which will make the operation unprovable.
Dont enforce mul/div relation when divisor is zero.
Context
miladpiri (zkSync) confirmed and commented:
Alex the Entreprenerd (judge) commented:
