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

Implement FRI committed layers #19

Closed

Conversation

varunthakore
Copy link
Contributor

Implements FRI layers and committed layers corresponding to the following Stone library:

https://github.com/starkware-libs/stone-prover/tree/main/src/starkware/fri

This PR has dependency on #18.

.collect()
}

fn clone_arc(&self) -> Arc<dyn FriLayer<F, E>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this method needed? Can't the user just wrap the thing in an Arc himself?

This also copies the underlying struct, I would imagine that the goal was to have a number of references to the same immutable instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, removed this function.

Copy link
Contributor

@rot256 rot256 left a comment

Choose a reason for hiding this comment

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

A couple questions, otherwise LGTM.

Arc::new(FriLayerProxy {
layer_size: self.layer_size,
domain: self.domain,
prev_layer: Arc::clone(&self.prev_layer),
Copy link
Contributor

Choose a reason for hiding this comment

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

self.prev_layer.clone() does the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the clone_arc function.


#[derive(Clone)]
pub struct FriLayerReal<F: PrimeField, E: EvaluationDomain<F>> {
layer_size: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

layer_size is a redundant field: it looks to be the same as domain.size()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed layer_size.

}
}

pub fn new_from_prev_layer(prev_layer: &dyn FriLayer<F, E>) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

This just clones the layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used to create FriLayerReal from the previous FriLayerProxy, both the structs implement FriLayer trait.

@varunthakore
Copy link
Contributor Author

Closing this PR since #24 is merged.

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