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

fix decoder rlc #1266

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/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ impl DecoderConfig {
let sequences_data_decoder = SequencesDataDecoder::configure(meta);
let sequence_execution_config = SequenceExecutionConfig::configure(
meta,
challenges,
challenges.keccak_input(),
&LiteralTable::construct([
q_enable.into(),
tag_config.tag.into(),
Expand Down Expand Up @@ -4203,7 +4203,7 @@ impl DecoderConfig {
)?;
let (exported_len, exported_rlc) = self.sequence_execution_config.assign(
layouter,
challenges,
challenges.keccak_input(),
literal_datas
.iter()
.zip(&sequence_info_arr)
Expand Down
21 changes: 9 additions & 12 deletions aggregator/src/aggregation/decoder/seq_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use halo2_proofs::{
use itertools::Itertools;
use tables::SeqInstTable;
use witgen::{SequenceExec, SequenceExecInfo, SequenceInfo, ZstdTag};
use zkevm_circuits::{
evm_circuit::{BaseConstraintBuilder, ConstrainBuilderCommon},
util::Challenges,
};
use zkevm_circuits::evm_circuit::{BaseConstraintBuilder, ConstrainBuilderCommon};

/// TODO: This is in fact part of the `BlockConfig` in
/// Decoder, we can use BlockConfig if it is decoupled
Expand Down Expand Up @@ -296,7 +293,7 @@ impl<F: Field> SeqExecConfig<F> {
/// the maxium rotation is prev(2), next(1)
pub fn configure(
meta: &mut ConstraintSystem<F>,
challenges: &Challenges<Expression<F>>,
challenges: Expression<F>,
literal_table: &LiteralTable,
inst_table: &SeqInstTable<F>,
seq_config: &SequenceConfig,
Expand Down Expand Up @@ -545,7 +542,7 @@ impl<F: Field> SeqExecConfig<F> {
decoded_rlc_prev.expr()
* select::expr(
decoded_len.expr() - decoded_len_prev.expr(),
challenges.evm_word(),
challenges,
1.expr(),
)
+ decoded_byte.expr(),
Expand Down Expand Up @@ -950,7 +947,7 @@ impl<F: Field> SeqExecConfig<F> {
pub fn assign<'a>(
&self,
layouter: &mut impl Layouter<F>,
chng: &Challenges<Value<F>>,
chng: Value<F>,
// per-block inputs: (literal, seq_info, seq_exec_trace)
per_blk_inputs: impl IntoIterator<Item = (&'a [u64], &'a SequenceInfo, &'a [SequenceExec])>
+ Clone,
Expand All @@ -969,7 +966,7 @@ impl<F: Field> SeqExecConfig<F> {
blk_ind = seq_info.block_idx;
(offset, decoded_len, decoded_rlc) = self.assign_block(
&mut region,
chng.evm_word(),
chng,
offset,
decoded_len,
decoded_rlc,
Expand Down Expand Up @@ -997,7 +994,7 @@ impl<F: Field> SeqExecConfig<F> {
pub fn mock_assign(
&self,
layouter: &mut impl Layouter<F>,
chng: &Challenges<Value<F>>,
chng: Value<F>,
n_seq: usize,
seq_exec_infos: &[SequenceExec],
literals: &[u8],
Expand All @@ -1017,7 +1014,7 @@ impl<F: Field> SeqExecConfig<F> {
let offset = self.init_top_row(&mut region, None)?;
let (offset, decoded_len, decoded_rlc) = self.assign_block(
&mut region,
chng.evm_word(),
chng,
offset,
0,
Value::known(F::zero()),
Expand Down Expand Up @@ -1163,7 +1160,7 @@ mod tests {
let chng_mock = MockChallenges::construct(meta);
let chng = chng_mock.exprs(meta);

let config = SeqExecConfig::configure(meta, &chng, &literal_tbl, &inst_tbl, &seq_cfg);
let config = SeqExecConfig::configure(meta, chng.keccak_input(), &literal_tbl, &inst_tbl, &seq_cfg);

Self::Config {
config,
Expand Down Expand Up @@ -1199,7 +1196,7 @@ mod tests {

config.config.mock_assign(
&mut layouter,
&chng_val,
chng_val.keccak_input(),
self.insts.len(),
&self.exec_trace,
&self.literals,
Expand Down
Loading