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

add Canonical(De-)Serialize to miller loop args #571

Closed

Conversation

achimcc
Copy link

@achimcc achimcc commented Dec 31, 2022

Description

Adds CanonicalSerialize and CanonicalDeserialize traits to the arguments of multi_miller_loop.

This originates from a discussion in #537 and is in some sense a follow-up of the PR's #534 and #542. It allows to avoid point preparation and instead to (de-)serialize the arguments of multi_miller_loop right away. It should finally be possible to over-come the forked models in paritytech/substrate#13031 with this.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
    - [ ] Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer
  • Adopted unit tests

@achimcc achimcc marked this pull request as ready for review December 31, 2022 06:27
@achimcc achimcc requested review from a team as code owners December 31, 2022 06:27
@achimcc achimcc requested review from Pratyush, mmagician and weikengchen and removed request for a team December 31, 2022 06:27
@achimcc achimcc marked this pull request as draft December 31, 2022 08:25
@achimcc
Copy link
Author

achimcc commented Dec 31, 2022

Need to fix the tests first, will do later!

@burdges
Copy link
Contributor

burdges commented Dec 31, 2022

Why does this help? Isn't it enough the specific model knows it can serialize its own G2Prepared?

@achimcc
Copy link
Author

achimcc commented Dec 31, 2022

Why does this help? Isn't it enough the specific model knows it can serialize its own G2Prepared?

But this is what @Pratyush suggested in #537 (comment) ?

There is something wrong with the test curves / test_pairing macro. The test curve's affine points should implement CanonicalSerialize but the tests are throwing some errors...

@achimcc
Copy link
Author

achimcc commented Dec 31, 2022

Changing <$Pairing>::multi_pairing(&[a, c], &[b, d]); -> <$Pairing>::multi_pairing([a, c], [b, d]); in the pairing testing macro in the test templates resolved the problem. I hope that's okay.

@achimcc
Copy link
Author

achimcc commented Jan 4, 2023

After a detailed discussion we concluded that we still have to fork the models for usage in Substrate so that this PR is no longer a requirement for us.

@achimcc achimcc closed this Jan 4, 2023
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