Skip to content

Commit

Permalink
fix todo
Browse files Browse the repository at this point in the history
  • Loading branch information
z2trillion committed Aug 21, 2024
1 parent ba059ad commit 8a66105
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions zkevm-circuits/src/bytecode_circuit/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,14 +1054,28 @@ impl<F: Field> SubCircuit<F> for BytecodeCircuit<F> {

/// Return the minimum number of rows required to prove the block
fn min_num_rows_block(block: &witness::Block) -> (usize, usize) {
(
block
.bytecodes
.values()
.map(witness::Bytecode::rows_required)
.sum(), // TODO: need to group by table.
block.circuits_params.max_bytecode,
)
#[cfg(feature = "dual_bytecode")]
let rows_required = {
let (first, second): (Vec<_>, _) =
block.bytecodes.values().partition(|b| b.in_first_table);
max(
first
.into_iter()
.map(witness::Bytecode::rows_required)
.sum(),
second
.into_iter()
.map(witness::Bytecode::rows_required)
.sum(),
)
};
#[cfg(not(feature = "dual_bytecode"))]
let rows_required = block
.bytecodes
.values()
.map(witness::Bytecode::rows_required)
.sum();
(rows_required, block.circuits_params.max_bytecode)
}

/// Make the assignments to the TxCircuit
Expand Down

0 comments on commit 8a66105

Please sign in to comment.