Skip to content

First iteration of circuits naming convention#341

Merged
ed255 merged 10 commits intomainfrom
feat/circuits-naming
Jul 15, 2025
Merged

First iteration of circuits naming convention#341
ed255 merged 10 commits intomainfrom
feat/circuits-naming

Conversation

@ed255
Copy link
Collaborator

@ed255 ed255 commented Jul 14, 2025

In this PR I remove all *Gadget types and instead implement the naming convention defined here #181 (comment)

The biggest changes can be summarised by:

  • a) Removal of *Gadget types and their eval_* methods in favour of verb_object_circuit functions.
  • b) The above functions don't create targets that need to be witness-assigned later. Instead they receive those as arguments. This clearly shows what's the circuit input and output.

I'm specially happy about the changes from b), I think they make the flow of data in the circuit more clear.

Missing things that I did not address in this PR

  • The RecursiveCircuit still uses some old naming conventions like build.
  • We have some *Target types that have methods that define constraints. I think we can keep those as they are convenient and I don't see them as strongly breaking the new convention: I see them as the object-oriented way to apply the convention. In those cases the object can be omitted from the method when it's implied by the type name, and the _circuit suffix doesn't appear because it's implied by the fact that the type is a *Target. Examples are: SignatureTarget::verify -> BoolTarget, StatementTarget::has_native_type -> BoolTarget or OperationTypeTarget::as_custom -> (BoolTarget, HashOutTarget, Target).

@ed255 ed255 requested a review from arnaucube July 14, 2025 16:03
Copy link
Collaborator

@arnaucube arnaucube left a comment

Choose a reason for hiding this comment

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

Nice, much better now! ^^

@ed255 ed255 merged commit 143a8c9 into main Jul 15, 2025
6 checks passed
@ed255 ed255 mentioned this pull request Jul 30, 2025
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