-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: sharding of global challenge phase commitment and opcode proving #695
base: master
Are you sure you want to change the base?
Conversation
@@ -90,33 +92,59 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMProver<E, PCS> { | |||
} | |||
exit_span!(span); | |||
|
|||
// TODO: is it better to set different size of different opcode? |
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, I think so. Why choosing 1048576
here?
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 few comments and questions. I'm still trying to understand what's going on.
@@ -90,33 +92,59 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMProver<E, PCS> { | |||
} | |||
exit_span!(span); | |||
|
|||
// TODO: is it better to set different size of different opcode? | |||
let shard_size = 1048576; |
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 might be easier to read in hex. (Because it's not just a random number.)
// TODO: (1) is it ok to store mle? (2) replace tuple with struct? | ||
#[allow(clippy::type_complexity)] | ||
let mut wits_and_commitments: BTreeMap< | ||
String, |
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.
What's the meaning of the key here? A type synonym might be useful here?
let mut commitments = BTreeMap::new(); | ||
let mut wits = BTreeMap::new(); | ||
// TODO: (1) is it ok to store mle? (2) replace tuple with struct? | ||
#[allow(clippy::type_complexity)] |
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.
Perhaps use some type synonym or so?
@@ -61,10 +61,11 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> ZKVMVerifier<E, PCS> | |||
does_halt: bool, | |||
) -> Result<bool, ZKVMError> { | |||
// require ecall/halt proof to exist, depending whether we expect a halt. | |||
// TODO: make it less adhoc |
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.
Especially once we support more ecalls. Or perhaps we should introduce a specific 'halt-successfully' introduction.
@@ -107,6 +110,42 @@ impl<T: Sized + Sync + Clone + Send + Copy> RowMajorMatrix<T> { | |||
}) | |||
.collect() | |||
} | |||
|
|||
// TODO: should we consume or clone `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.
If it's natural to consume self
, then do so. The caller can clone.
The sharding in first layer circuit is quite simple. While sharding+recursion-circuit will be where most magic happens.
Pending designs:
OpcodeProof
struct as a vector of shard proofs?TODOs
inside the PR.Other notes:
into_mle
input is 8xSHARD_SIZE. It is as expected related to some FAN_IN mle parameter.Perf (MBP M3)