Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign fields 4: Multiplication #1223

Merged
merged 37 commits into from
Nov 21, 2023
Merged

Foreign fields 4: Multiplication #1223

merged 37 commits into from
Nov 21, 2023

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Nov 2, 2023

  • add 3 different gadgets that use the ffmul gate: ForeignField.mul(), ForeignField.inv(), ForeignField.div()
  • add foreign field unit tests with numbers not reduced modulo f, where applicable
  • change the return signature of ZkProgram.analyzeMethods() to be nicer to read and to match SmartContract.analyzeMethods() (seems kinda unrelated; I did this to inspect number of rows of some ffmul methods. It's technically a breaking change but low impact)

bindings: o1-labs/o1js-bindings#206

closes #1142

@mitschabaude mitschabaude changed the title Foreign field multiplication Foreign fields 4: Multiplication Nov 13, 2023
@mitschabaude mitschabaude linked an issue Nov 15, 2023 that may be closed by this pull request
@mitschabaude mitschabaude marked this pull request as ready for review November 15, 2023 11:33
@mitschabaude mitschabaude requested a review from a team as a code owner November 15, 2023 11:33
Copy link
Member

@Trivo25 Trivo25 left a comment

Choose a reason for hiding this comment

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

this is awesome! Really appreciate all the descriptive comments

src/lib/gadgets/common.ts Show resolved Hide resolved
Copy link
Member

@querolita querolita left a comment

Choose a reason for hiding this comment

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

Excellent job! I would nonetheless like to clarify a question about the circuit shape before accepting, to make sure all checks are getting in. I also have a question regarding division 💯

src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Outdated Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Outdated Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.unit-test.ts Outdated Show resolved Hide resolved
src/lib/gadgets/foreign-field.unit-test.ts Show resolved Hide resolved
Base automatically changed from feature/ffadd to main November 17, 2023 16:33
Copy link

@jspada jspada left a comment

Choose a reason for hiding this comment

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

Approved with minor suggestions and a question.

src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.ts Show resolved Hide resolved
src/lib/gadgets/foreign-field.unit-test.ts Show resolved Hide resolved
src/lib/gates.ts Show resolved Hide resolved
@mitschabaude mitschabaude merged commit 084a1e7 into main Nov 21, 2023
13 checks passed
@mitschabaude mitschabaude deleted the feature/ffmul branch November 21, 2023 16:27
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.

Port FFMUL gadget to TypeScript
4 participants