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

vendor R1CS sponge code #46

Merged
merged 4 commits into from
Apr 26, 2023
Merged

vendor R1CS sponge code #46

merged 4 commits into from
Apr 26, 2023

Conversation

redshiftzero
Copy link
Member

Towards penumbra-zone/penumbra#2004:

This is the `r1cs` branch from our git fork of `ark-sponge`:

https://github.com/penumbra-zone/sponge

It is unmodified in this commit, changes will be made in the
subsequent commits for clarity of the git history.

The upstream `ark-sponge` repository is archived because they moved
the poseidon implementation to a different repository. In addition,
we need to make a lot of changes to get on the upstream impl. This
was attempted back in November and at that time we decided to continue
using our fork only for the R1CS feature.

However, in light of the upcoming migration to Poseidon2, any work
resolving the divergence between our fork and the upstream repo would
be wasted, as we'll be soon removing Poseidon 1 from `poseidon377`.

As such, for stability, we are vendoring our fork of `ark-sponge`
on a temporary basis such that we can release `poseidon377` unchanged
to crates, then pin all penumbra repositories to that release.

Afterwards, we will proceed with migrating to Arkworks 0.4.x release
series [0] and migrating to Poseidon2 [1].

[0] penumbra-zone/penumbra#2004
[1] #40
paths to the crate root `crate` in vendored `ark-sponge` need to be
`crate::r1cs::vendor::sponge`
This test is failing in the forked repo, after the change in:

penumbra-zone/sponge@113469a

That change was previously made for consistency with our `poseidon377` test
vectors (after ark-sponge changed how they invoke the permutation in the
sponge). Our poseidon377 vectors are `crate::hash` in the tests
as well as in the protocol spec - those tests pass so there
should be no issues with consistency across implementations.
@redshiftzero redshiftzero merged commit f35cd14 into main Apr 26, 2023
@redshiftzero redshiftzero deleted the vendor-ark-sponge branch April 26, 2023 19:12
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.

1 participant