Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Port generic gadgets from Blindbid library to this one. #12

Merged
merged 7 commits into from
Aug 11, 2020

Conversation

CPerezz
Copy link
Contributor

@CPerezz CPerezz commented Aug 11, 2020

Since this is a general-purpose gadget and it's not specific
to the blindibd library, it is more useful to have this kind of
gadgets on this repo as a "container" shared across all of our
libraries.

Closes #10

CPerezz added 6 commits August 10, 2020 11:46
Since the latest version of PLONK already includes
builtin functions with dedicated custom gates in order
to perform ECC operations. It doesn't make any sense
to have them re-defined here since take like 10x more constraints
than the ones built-in plonk.
- Use the latest version of `dusk-plonk`
- Add anyhow & thiserror for error handling.
- Remove the rest of no-longer-needed dependencies.
We have and will have more gadgets that might fail
due to some computations that need to be performed inside.

Therefore, `GadgetErrors` enum is created in order to hold
all of the error variants that we might have in our gadgets
execution processes.
- Refactored the API since a lot of functions were different.
- Optimized the `non_zero` gadget to use less gates.
The previous tests were too large and also difficult
to understand. Now the tests are much cleaner for the
conditional selection gadgets for correct and incorrect
cases.
@CPerezz CPerezz self-assigned this Aug 11, 2020
Since this is a general-purpose gadget and it's not specific
to the blindibd library, it is more useful to have this kind of
gadgets on this repo as a "container" shared across all of our
libraries.

Closes #10
@CPerezz CPerezz marked this pull request as ready for review August 11, 2020 07:29
@CPerezz CPerezz requested review from vlopes11 and ZER0 August 11, 2020 07:29
@CPerezz CPerezz added the type:tech-debt the issue is a tech debt that needs fixing label Aug 11, 2020
Copy link
Contributor

@vlopes11 vlopes11 left a comment

Choose a reason for hiding this comment

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

Some minor optimizations would be more readable

src/gadgets/scalar/range.rs Show resolved Hide resolved
src/gadgets/scalar/range.rs Show resolved Hide resolved
@CPerezz CPerezz requested a review from vlopes11 August 11, 2020 12:46
@CPerezz CPerezz merged commit b208fc4 into master Aug 11, 2020
@CPerezz CPerezz deleted the blindbid_gadgets_porting branch August 11, 2020 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:tech-debt the issue is a tech debt that needs fixing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port BlindBid lib gadgets to this library
2 participants