Skip to content

Remove log_sizes field from CircuitClaim#477

Open
ilyalesokhin-starkware wants to merge 1 commit intoilya/log_sizesfrom
ilya/mix
Open

Remove log_sizes field from CircuitClaim#477
ilyalesokhin-starkware wants to merge 1 commit intoilya/log_sizesfrom
ilya/mix

Conversation

@ilyalesokhin-starkware
Copy link
Copy Markdown
Contributor

Component log sizes are fixed given the CircuitConfig, so derive them
from the preprocessed trace at proving time and route them through the
Cairo Statement's claims_to_mix rather than mixing them via
CircuitClaim::mix_into.

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 30, 2026

PR Summary

Medium Risk
Changes the proof transcript contents and how component sizes are threaded through prover/verifier; mismatches would break proof verification across implementations.

Overview
Removes per-component log_sizes from CircuitClaim and stops mixing component log sizes via CircuitClaim::mix_into, relying on the fixed N_COMPONENTS/enable bits plus output values only.

The prover now computes component_log_sizes from the preprocessed trace during write_trace, threads them separately into write_interaction_trace and CircuitComponents::new, and asserts they match circuit_verifier::statement::component_log_sizes. On the verifier side, component log sizes are no longer mixed directly; instead they’re included in Cairo’s statement claims_to_mix, and the simple verifier examples/tests are updated to match the new channel transcript.

Reviewed by Cursor Bugbot for commit e4899a5. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare
Copy link
Copy Markdown
Collaborator

This change is Reviewable

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Component log sizes are fixed given the CircuitConfig, so derive them
from the preprocessed trace at proving time and route them through the
Cairo Statement's claims_to_mix rather than mixing them via
CircuitClaim::mix_into.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 e4899a5. Configure here.

use crate::relations::{BLAKE_STATE_RELATION_ID, CommonLookupElements, GATE_RELATION_ID};
use circuits::ivalue::qm31_from_u32s;
use circuits_stark_verifier::proof_from_stark_proof::{pack_component_log_sizes, pack_enable_bits};
use circuits_stark_verifier::proof_from_stark_proof::pack_enable_bits;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pack_component_log_sizes is now unused dead code

Low Severity

The pack_component_log_sizes function in proof_from_stark_proof.rs is now dead code. All call sites were removed in this PR (from circuit_claim.rs, simple_air.rs, and simple_air_test.rs), but the function definition was left behind. A grep confirms the only remaining match is the definition itself.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e4899a5. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants