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

AllocatedScalar refactor #566

Merged
merged 8 commits into from
Sep 6, 2021
Merged

AllocatedScalar refactor #566

merged 8 commits into from
Sep 6, 2021

Conversation

CPerezz
Copy link
Contributor

@CPerezz CPerezz commented Sep 3, 2021

Add AllocatedScalar as part of PLONK's external API

Now instead of mangling with Variables, users will use
AllocatedScalar instead which includes a reference to the
Scalar a Variable references.

  • Make all pub fn's get and return AllocatedScalar in their
    signatures.

Now the Variable type is something more internal to the crate and
there should not be any uses for it outside of the crate internals.

This is required in order to be able to externalized some gadgets added into this lib in modularized_plookup branch which should have never been included here and need this API change in order to be a thing outside of the lib itself.

Resolves: #565

@CPerezz CPerezz added the team:Core Low Level Core Development Team (Rust) label Sep 3, 2021
Now instead of mangling with `Variable`s, users will use
`AllocatedScalar` instead which includes a reference to the
Scalar a `Variable` references.

- Make all pub fn's get and return `AllocatedScalar` in their
signatures.

Now the `Variable` type is something more internal to the crate and
there should not be any uses for it outside of the crate internals.
Implements not only all the associated fns needed by `AllocatedScalar`
consumers but also all the comodity trait implementations to be able to
operate with them on a confy manner.
This includes:
- arithmetic
- range
- logic
- boolean
- basic conditional selection & other utilities

Now all the aformentioned modules and it's exported functions make use
of `AllocatedScalar` and ask for it on their signatures to the lib
consumers.
Copy link
Contributor

@LukePearson1 LukePearson1 left a comment

Choose a reason for hiding this comment

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

This PR LGTM!

I've been through it with @EDGDrummond and it solves the problem of exposing the inner scalar for decomposition gadgets. Feel free to merge.

Copy link

@EDGDrummond EDGDrummond left a comment

Choose a reason for hiding this comment

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

Changes look good to me, will now allow us to remove reinforced concrete's decomposition functionality from plonk and add to RC repo

@CPerezz CPerezz merged commit 572e296 into release-0.9 Sep 6, 2021
@CPerezz CPerezz deleted the allocated_scalar branch September 6, 2021 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:Core Low Level Core Development Team (Rust)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants