Add extra constraints to prevent register side effects in CPU32 padding rows#646
Add extra constraints to prevent register side effects in CPU32 padding rows#646RobinJadoul wants to merge 2 commits into
Conversation
Codex Code ReviewFindings:
|
| [[constraints.logup]] | ||
| kind = "arith" | ||
| constraint = "$#`!μ` => #`read_register1 = 0`$" | ||
| poly = ["*", ["not", "μ"], "read_register1"] | ||
|
|
||
| [[constraints.logup]] | ||
| kind = "arith" | ||
| constraint = "$#`!μ` => #`read_register2 = 0`$" | ||
| poly = ["*", ["not", "μ"], "read_register2"] | ||
|
|
||
| [[constraints.logup]] | ||
| kind = "arith" | ||
| constraint = "$#`!μ` => #`write_register = 0`$" | ||
| poly = ["*", ["not", "μ"], "write_register"] |
There was a problem hiding this comment.
Potential gap: ALU interaction multiplicity is not gated on μ
The three new constraints correctly prevent register read/write side effects in padding rows. However, there is a similar interaction in the alu group:
[[constraints.alu]]
kind = "interaction"
tag = "ALU"
...
multiplicity = "ALU"ALU is constrained to be a bit, but there is no constraint !μ => ALU = 0. A malicious prover could set ALU = 1 in a padding row (μ = 0) and inject a spurious entry into the ALU logup bus. Whether this is exploitable depends on whether the ALU chip has independent constraints preventing it from matching against rows not associated with real instructions.
If the ALU chip is not separately constrained, a !μ => ALU = 0 constraint should be added here alongside the three existing ones.
There was a problem hiding this comment.
ALU should be free of side-effects, and is similarly not gated on word_instr in the CPU chip
Review: Add extra constraints to prevent register side effects in CPU32 padding rowsSummary: This PR fixes a real ZK soundness bug — padding rows (μ = 0) could previously be used by a malicious prover to inject spurious register reads/writes into the logup argument via the MEMW interactions. The fix is logically correct. What's correct
Issues found
|
No description provided.