Skip to content

Feat/add exp gate#257

Merged
ed255 merged 2 commits intomainfrom
feat/add-exp-gate
Jun 6, 2025
Merged

Feat/add exp gate#257
ed255 merged 2 commits intomainfrom
feat/add-exp-gate

Conversation

@ainta
Copy link
Collaborator

@ainta ainta commented Jun 5, 2025

@ainta ainta requested a review from arnaucube June 5, 2025 04:33
@ed255
Copy link
Collaborator

ed255 commented Jun 5, 2025

As discussed in the Telegram chat, the idea for introduction gadgets is that they can use their own configuration and set of gates without requiring modification of the standard set of gates from the recursive MainPod. This is achieved by adding a wrapping circuit that "normalizes" the proof, see the current implementation of 0xPARC/introduction-pods#1 for reference.

I've found the source of this gate:

The recursive verifier calls this function https://github.com/0xPolygonZero/plonky2/blob/82791c4809d6275682c34b926390ecdbdc2a5297/plonky2/src/gadgets/arithmetic.rs#L288-L291
And I believe the length of exponent_bits is related to the proof size (number of gates).
For example I've tried generating a verifier from the Recursive Main Pod and the length is 19, which is below
self.num_base_arithmetic_ops_per_gate()=20.
In the ed25519 circuit this length is 22 which causes the verifier to use the ExponentiationGate.

So this gate is not related to a gate that the ed25519 circuit uses but the fact that the proof is very big and requires an extra gate to be verified.

If this was about a special configuration/common that the introductory gadget needs I don't think we should add this gate to the standard list, but since this is a generic case of a big proof, and currently the proof we're verifying in the Recursive MainPod is alreay big-ish, I think it's OK to add the ExponentiationGate to the standard list of gates.

Note that the situation would be different in approach (b) from #252 (but we can cross that bridge when we come to it)

@ed255
Copy link
Collaborator

ed255 commented Jun 5, 2025

Also could you rebase/merge with main?

@ainta ainta force-pushed the feat/add-exp-gate branch from 7066356 to 9c1f5c5 Compare June 5, 2025 21:44
Co-authored-by: Eduard S. <eduardsanou@posteo.net>
@ainta ainta requested a review from ed255 June 5, 2025 21:55
Copy link
Collaborator

@ed255 ed255 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ed255 ed255 merged commit e8edbbc into main Jun 6, 2025
6 checks passed
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