Move component log sizes from proof claim to Statement#476
Move component log sizes from proof claim to Statement#476ilyalesokhin-starkware wants to merge 1 commit intomainfrom
Conversation
PR SummaryMedium Risk Overview Verifier channel mixing now sources component log sizes from the Circuit/Cairo statements/configs are updated to provide those log sizes. Tests/examples are adjusted for the new APIs and updated expected proof size totals. Reviewed by Cursor Bugbot for commit ce255e1. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Will revisit after moving to blake in gates. |
a0d8cda to
879b009
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
The Statement trait now exposes get_component_log_sizes; verify reads log sizes from the statement instead of proof.claim. The Claim struct is removed (claimed_sums is now a top-level field on Proof), shrinking the serialized proof by one packed-u8 entry per component. CircuitStatement derives the per-component log sizes from n_blake_compress (added to CircuitParams/CircuitConfig) plus preprocessed column log sizes, and now takes &CircuitConfig instead of seven individual fields. Cairo's component log sizes ride along on public_claim, removing the dedicated field on CairoVerifierConfig. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
879b009 to
ce255e1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ce255e1. Configure here.
| pub const VERIFY_BITWISE_XOR_9: u32 = 18; | ||
| pub const RANGE_CHECK_15: u32 = 15; | ||
| pub const RANGE_CHECK_16: u32 = 16; | ||
| } |
There was a problem hiding this comment.
Hardcoded log size constants risk diverging from source
Medium Severity
The component_log_size module hardcodes literal values for seven constants (BLAKE_ROUND_SIGMA, VERIFY_BITWISE_XOR_8, VERIFY_BITWISE_XOR_4, VERIFY_BITWISE_XOR_7, VERIFY_BITWISE_XOR_9, RANGE_CHECK_15, RANGE_CHECK_16) while VERIFY_BITWISE_XOR_12 correctly references super::verify_bitwise_xor_12::LOG_SIZE. Since all these component modules are already imported, the other constants could similarly reference their canonical LOG_SIZE source. If a component's LOG_SIZE changes in the future, the hardcoded verifier values would silently become stale, causing valid proofs to be rejected (a Fiat-Shamir transcript mismatch).
Reviewed by Cursor Bugbot for commit ce255e1. Configure here.



The Statement trait now exposes get_component_log_sizes; verify reads log sizes from the statement instead of proof.claim. The Claim struct is removed (claimed_sums is now a top-level field on Proof), shrinking the serialized proof by one packed-u8 entry per component.
CircuitStatement derives the per-component log sizes from n_blake_compress (added to CircuitParams/CircuitConfig) plus preprocessed column log sizes, and now takes &CircuitConfig instead of seven individual fields. Cairo's component log sizes ride along on public_claim, removing the dedicated field on CairoVerifierConfig.