-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement FRI committed layers #19
Conversation
.collect() | ||
} | ||
|
||
fn clone_arc(&self) -> Arc<dyn FriLayer<F, E>> { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed this function.
There was a problem hiding this 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), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Closing this PR since #24 is merged. |
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.