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

Decoder "input region" #1217

Merged
merged 7 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aggregator/src/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod circuit;
/// Config for aggregation circuit
mod config;
/// Config for decoding zstd-encoded data.
mod decompression;
mod decoder;
/// config for RLC circuit
mod rlc;

Expand All @@ -18,7 +18,7 @@ pub(crate) use barycentric::{
};
pub(crate) use batch_data::BatchDataConfig;
pub(crate) use blob_data::BlobDataConfig;
pub(crate) use decompression::decoder::DecoderConfig;
pub(crate) use decoder::DecoderConfig;
pub(crate) use rlc::RlcConfig;

pub use circuit::AggregationCircuit;
Expand Down
4 changes: 2 additions & 2 deletions aggregator/src/aggregation/batch_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct AssignedBatchDataConfig {
impl BatchDataConfig {
pub fn configure(
meta: &mut ConstraintSystem<Fr>,
challenge: Challenges<Expression<Fr>>,
challenge: &Challenges<Expression<Fr>>,
u8_table: U8Table,
range_table: RangeTable<MAX_AGG_SNARKS>,
keccak_table: &KeccakTable,
Expand Down Expand Up @@ -357,7 +357,7 @@ impl BatchDataConfig {
},
);

assert!(meta.degree() <= 5);
assert!(meta.degree() <= 4);

config
}
Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregation/blob_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl BlobDataConfig {
vec![(byte_value, u8_table.into())]
});

assert!(meta.degree() <= 5);
assert!(meta.degree() <= 4);

config
}
Expand Down
25 changes: 21 additions & 4 deletions aggregator/src/aggregation/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use snark_verifier::{
};
use zkevm_circuits::{
keccak_circuit::{KeccakCircuitConfig, KeccakCircuitConfigArgs},
table::{KeccakTable, RangeTable, U8Table},
table::{KeccakTable, PowOfRandTable, RangeTable, U8Table},
util::{Challenges, SubCircuitConfig},
};

Expand Down Expand Up @@ -116,11 +116,26 @@ impl AggregationConfig {
let range_table = RangeTable::construct(meta);
let challenges_expr = challenges.exprs(meta);
let blob_data_config = BlobDataConfig::configure(meta, u8_table);
let batch_data_config =
BatchDataConfig::configure(meta, challenges_expr, u8_table, range_table, &keccak_table);
let batch_data_config = BatchDataConfig::configure(
meta,
&challenges_expr,
u8_table,
range_table,
&keccak_table,
);

// Zstd decoder.
let decoder_config = DecoderConfig::configure(meta);
let pow_rand_table = PowOfRandTable::construct(meta, &challenges_expr);
let range8 = RangeTable::construct(meta);
let range16 = RangeTable::construct(meta);
let decoder_config = DecoderConfig::configure(
meta,
&challenges_expr,
pow_rand_table,
u8_table,
range8,
range16,
);

// Instance column stores public input column
// - the accumulator
Expand All @@ -129,6 +144,8 @@ impl AggregationConfig {
let instance = meta.instance_column();
meta.enable_equality(instance);

println!("meta degree = {:?}", meta.degree());

Self {
base_field_config,
rlc_config,
Expand Down
Loading
Loading