-
Notifications
You must be signed in to change notification settings - Fork 391
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
Proof aggregation circuit #523
Conversation
36e84c7
to
63a9a72
Compare
a9db3f5
to
19a7110
Compare
6d6209e
to
4d66cd9
Compare
4c11fb7
to
c0f5b94
Compare
the conflicts seems strange... i will resolve it... |
/// Instance for public input; stores | ||
/// - accumulator from aggregation (12 elements) | ||
/// - aggregated public inputs (136 elements): | ||
/// chain_id || |
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.
chain_id is now put at last for instance in accordance with
// last 8 inputs are the chain id |
aggregator/figures/architecture.png
Outdated
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.
In the compression process, pi are carried through without change. In the aggregation process, pi are aggregated using pi agg circuit and snarks are aggregated using KzgAs. Then two parts are put together in proof agg circuit. It may be a good idea to illustrate these inside the figure?
* a few comments inside core function for proof compression: extract_accumulators_and_proof * comments on proof compression circuit * comments on pi aggregation circuit, especially calculation of hash indexes when using Keccak circuit, which are hard-coded here so needs be very careful * comments on proof aggregation circuit * a few comments inside core function for proof compression: extract_accumulators_and_proof * comments on proof compression circuit * comments on pi aggregation circuit, especially calculation of hash indexes when using Keccak circuit, which are hard-coded here so needs be very careful * comments on proof aggregation circuit * clean up all commits from my side * clean up of all commits on my side
aggregator/src/batch.rs
Outdated
// chunk[k-1].withdraw_root || | ||
// batch_data_hash ) | ||
let preimage = [ | ||
chunk_hashes[0].chain_id.to_le_bytes().as_ref(), |
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.
Solidity always uses the big-endian encoding.
chunk_hashes[0].chain_id.to_le_bytes().as_ref(), | |
chunk_hashes[0].chain_id.to_be_bytes().as_ref(), |
da99d43
to
65912f6
Compare
@@ -0,0 +1 @@ | |||
{"strategy":"Simple","degree":26,"num_advice":[1],"num_lookup_advice":[1],"num_fixed":1,"lookup_bits":20,"limb_bits":88,"num_limbs":3} |
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.
I remember @lispc mentioned that degree 25 would also work?
} | ||
} | ||
|
||
pub(crate) fn _compress_wide_param() -> 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.
is _compress_wide_param
and _compress_thin_param
just for test cases?
// data hash + public_input_hash = snark public input | ||
assert_eq!( | ||
Fr::from(chunk.data_hash.as_bytes()[i] as u64), | ||
snark_hash_bytes[i + 20] |
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.
replace 20 by SNARK_DATA_HASH_OFFSET
|
||
assert_eq!( | ||
Fr::from(chunk_hash_bytes[i] as u64), | ||
snark_hash_bytes[i + 52] |
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.
replace 52 by SNARK_PI_HASH_OFFSET
the compression part has been merged |
replaced with #670 Static proof aggregation |
closed as #670 is merged |
Description
ported from https://github.com/scroll-tech/aggregator
Issue Link
[link issue here]
Type of change
Contents
Rationale
[design decisions and extended information]
How Has This Been Tested?
Blocked by #522