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

feat: void return gadgets, multiple circuits export and Vector optimisation #38

Merged
merged 66 commits into from
Sep 25, 2023

Conversation

Eagle941
Copy link
Contributor

@Eagle941 Eagle941 commented Sep 9, 2023

Summary

  • Added support for gadgets which return void.
  • Added support for extraction of multiple gadgets/circuits with single function call.
  • Implemented frontend.Compiler interface for CodeExtractor and implemented functions Field() and FieldBitLen().
  • Added optimisation for Vectors extraction: the extractor checks if it's possible to pass the whole vector instead of reconstructing it.
  • Added support for gadgets returning n-dimension frontend.Variable slices
  • Added support for gadgets returning nothing
  • Added better error handling, catching a panic and returning an error

Plus other stability hotfixes.

Details

Stability hotfixes:

  • Support for nested slices in gadget initialisation (achieved through function flattenSlice)
  • Explicit coercion to F type for Const fields, except for int types (achieved by creation of a new type Integer)
  • Added check in abstractor.CallGadget to make sure the argument is of type frontend.API
  • Checking no whitespace is present in namespace tag
  • nil input variables initialised to 0
  • Fixed bug in function cloneGadget which wouldn't deep copy nested slices. I have imported the library mitchellh/copystructure as a better alternative to homebrewed solution.

Additional test examples included plus automatic check of test output with reference extracted circuit.

Checklist

  • Documentation has been updated if necessary.

@Eagle941 Eagle941 requested a review from a team as a code owner September 9, 2023 13:09
@Eagle941 Eagle941 changed the title feat: void return gadgets feat: void return gadgets Sep 9, 2023
@Eagle941 Eagle941 changed the title feat: void return gadgets feat: void return gadgets and multiple gadgets export Sep 9, 2023
@Eagle941 Eagle941 changed the title feat: void return gadgets and multiple gadgets export feat: void return gadgets, multiple circuits export and Vector optimisation Sep 18, 2023
@Eagle941 Eagle941 merged commit 4ac7e56 into main Sep 25, 2023
1 check passed
@Eagle941 Eagle941 deleted the flatten_slice_fix branch September 25, 2023 15:42
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