Skip to content

Move seq_of_component_size into ComponentDataTrait#450

Draft
noa-starkware wants to merge 1 commit intonoa/narrower-arg-seq-of-component-sizefrom
noa/seq-of-component-size-on-trait
Draft

Move seq_of_component_size into ComponentDataTrait#450
noa-starkware wants to merge 1 commit intonoa/narrower-arg-seq-of-component-sizefrom
noa/seq-of-component-size-on-trait

Conversation

@noa-starkware
Copy link
Copy Markdown
Contributor

Summary

  • seq_of_component_size is now a default method on ComponentDataTrait in stark_verifier
  • Removed the free functions and the now-empty component_utils modules in cairo_air and circuit_air
  • All 17 call sites updated to method syntax: component_data.seq_of_component_size(...)

Stacks on #449. Part of audit cleanup (ilya/audit2 TODO comments).

🤖 Generated with Claude Code

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 12, 2026

PR Summary

Medium Risk
Touches core constraint-evaluation plumbing by adding a default method on ComponentDataTrait and updating many call sites; while intended as a pure refactor, any mismatch in seq_* column selection would affect constraint composition across components.

Overview
Moves seq_of_component_size from per-crate helper modules into stark_verifier as a default method on ComponentDataTrait, centralizing the logic that selects the correct seq_{log_size} preprocessed column based on the component’s instance-size bits.

Removes the now-redundant component_utils modules from cairo_air and circuit_air (and their prelude re-exports) and updates all call sites to use method syntax: component_data.seq_of_component_size(context, &acc.preprocessed_columns).

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

@reviewable-StarkWare
Copy link
Copy Markdown
Collaborator

This change is Reviewable

@noa-starkware noa-starkware self-assigned this Apr 12, 2026
@noa-starkware noa-starkware force-pushed the noa/seq-of-component-size-on-trait branch from 23ca5ad to 3e71667 Compare April 12, 2026 13:41
@noa-starkware noa-starkware force-pushed the noa/narrower-arg-seq-of-component-size branch from e628619 to 660bde1 Compare April 12, 2026 13:46
@noa-starkware noa-starkware force-pushed the noa/seq-of-component-size-on-trait branch from 3e71667 to 3e1307c Compare April 12, 2026 13:47
@noa-starkware noa-starkware force-pushed the noa/narrower-arg-seq-of-component-size branch from 660bde1 to 36dc977 Compare April 12, 2026 13:49
Add seq_of_component_size as a default method on ComponentDataTrait,
removing the free functions in component_utils and the now-empty modules.
Call sites updated to method syntax.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@noa-starkware noa-starkware force-pushed the noa/seq-of-component-size-on-trait branch from 3e1307c to d6e8eea Compare April 12, 2026 13:49
@noa-starkware noa-starkware marked this pull request as draft April 12, 2026 13:50
@ilyalesokhin-starkware
Copy link
Copy Markdown
Contributor

crates/stark_verifier/src/constraint_eval.rs line 84 at r1 (raw file):

        // Assert that the component size was one of the supported sizes
        use circuits::ops::eq;
        eq(context, sum_bits, context.one());

Suggestion:

        circuits::ops::eq(context, sum_bits, context.one());

@ilyalesokhin-starkware
Copy link
Copy Markdown
Contributor

crates/stark_verifier/src/constraint_eval.rs line 76 at r1 (raw file):

            };

            let bit = self.get_n_instances_bit(context, log_size);

I think the motivation for moving this function was to avoid this abstraction.

Code quote:

let bit = self.get_n_instances_bit(context, log_size);

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.

3 participants