Repository navigation
Commit 88a54cf
authored
refactor(stark): the grinding factor is not "security_bits" (#979)
Three local bindings read `proof_options.grinding_factor` and named it
`security_bits`, then passed it to functions whose own parameter is
`grinding_factor`:
prover.rs:2286 let security_bits = air.context().proof_options.grinding_factor;
verifier.rs:1582 let security_bits = air.context().proof_options.grinding_factor;
verifier.rs:1665 let security_bits = air.context().proof_options.grinding_factor;
Grinding is not the security level. It is one term in the query round's error,
and it cannot move the commit-phase term at all — so a reader who takes these
bindings at their word concludes the proof carries 20 bits of security, or that
raising the grinding factor raises security generally. Neither follows.
`grinding_factor` is what every function behind these call sites already calls
the argument (`grinding::is_valid_nonce`, `generate_nonce`,
`generate_nonce_maybe_gpu`), so the rename removes a mismatch rather than
introducing a new convention. Nothing is shadowed: the name appeared in these
two files only as the struct field being read.
Eight identifier occurrences, no behaviour, no field moved. The one operator-
facing message in the area already says the right thing — `error!("Grinding
factor not satisfied")` — so no text needed correcting alongside the names.1 parent fb6f23e commit 88a54cf
2 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2283 | 2283 | | |
2284 | 2284 | | |
2285 | 2285 | | |
2286 | | - | |
| 2286 | + | |
2287 | 2287 | | |
2288 | | - | |
| 2288 | + | |
2289 | 2289 | | |
2290 | | - | |
| 2290 | + | |
2291 | 2291 | | |
2292 | 2292 | | |
2293 | 2293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1579 | 1579 | | |
1580 | 1580 | | |
1581 | 1581 | | |
1582 | | - | |
| 1582 | + | |
1583 | 1583 | | |
1584 | | - | |
| 1584 | + | |
1585 | 1585 | | |
1586 | 1586 | | |
1587 | 1587 | | |
| |||
1662 | 1662 | | |
1663 | 1663 | | |
1664 | 1664 | | |
1665 | | - | |
1666 | | - | |
| 1665 | + | |
| 1666 | + | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | 1671 | | |
| |||
0 commit comments