Skip to content

Add serialization for Polynomials and Evaluations - #144

Merged
weikengchen merged 2 commits into
masterfrom
poly-serialization
Dec 17, 2020
Merged

Add serialization for Polynomials and Evaluations#144
weikengchen merged 2 commits into
masterfrom
poly-serialization

Conversation

@weikengchen

@weikengchen weikengchen commented Dec 17, 2020

Copy link
Copy Markdown
Member

Description

This PR adds serialization for polynomials and evalutions.


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 (main)
  • 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

@weikengchen
weikengchen merged commit 4af7c62 into master Dec 17, 2020
@weikengchen
weikengchen deleted the poly-serialization branch December 17, 2020 10:04
type_id.serialize(&mut writer)?;

match self {
GeneralEvaluationDomain::Radix2(d) => d.serialize(&mut writer),

@ValarDragon ValarDragon Dec 18, 2020

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we instead add a serialization method on the underlying domains, instead of serializing the degree directly?

Feels to weird to only have the general evaluation domain have serialize, and not the underlying domains

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh I see the underlying methods the d here is domain, not degree. Can the variable be changed throughout the file to be domain instead of d

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. I can do the change. I also have implemented the serialization for domains.

The serialization of domains is needed to serialize the evaluations.

@ValarDragon

Copy link
Copy Markdown
Collaborator

Can we ensure that PR's have at least one person reviewing them before merging on algebra?

Comment thread CHANGELOG.md
- #126 (ark-ec) Use `ark_ff::batch_inversion` for point normalization
- #131, #137 (ark-ff) Speedup `sqrt` on fields when a square root exists. (And slows it down when doesn't exist)
- #141 (ark-ff) Add `Fp64`
- #144 (ark-poly) Add serialization for polynomials and evaluations

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR is a breaking change, can you move it to the relevant section. (Its added a serialization trait bound to all polynomials)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All the polynomial implementations in this repo have now implemented the serialization. I assume there is another project also using polynomial?

@ValarDragon ValarDragon Dec 18, 2020

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IDK if there exists another project that implements polynomial, but if they did their implementation is now broken
Having all the reasons your code may be broken after an upgrade is really useful though

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also could the ark-poly readme be updated for this change (https://github.com/arkworks-rs/algebra/tree/master/poly)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

On the way

@ValarDragon ValarDragon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please move the changelog update to be a breaking change

type_id.serialize(&mut writer)?;

match self {
GeneralEvaluationDomain::Radix2(d) => d.serialize(&mut writer),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh I see the underlying methods the d here is domain, not degree. Can the variable be changed throughout the file to be domain instead of d

@weikengchen weikengchen mentioned this pull request Dec 18, 2020
6 tasks
@weikengchen

Copy link
Copy Markdown
Member Author

Sorry that this PR has caused a few troubles, including one for Tom's PR (#140)... Will surely request a review in the future.

@ValarDragon

Copy link
Copy Markdown
Collaborator

Not a huge issue =) , but at least for algebra getting one review is definitely important

@weikengchen

Copy link
Copy Markdown
Member Author

Understood :)

weikengchen added a commit that referenced this pull request Dec 18, 2020
* CHANGELOG correction

* update poly README
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