Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
optimise gadget cell usage
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Jun 19, 2023
1 parent 7b1dc94 commit 6bc88fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions zkevm-circuits/src/evm_circuit/execution/callop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@ impl<F: Field> ExecutionGadget<F> for CallOpGadget<F> {
cb.call_context_lookup_write(Some(callee_call_id.expr()), field_tag, value);
}

for (field_tag, value) in [] {
cb.call_context_lookup_write(Some(callee_call_id.expr()), field_tag, value);
}

// Give gas stipend if value is not zero
let callee_gas_left = callee_gas_left
+ call_gadget.has_value.clone() * GAS_STIPEND_CALL_WITH_VALUE.expr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
witness::{Block, Call, ExecStep, Transaction},
},
util::{
word::{Word, Word32Cell, WordExpr},
word::{Word, WordCell, WordExpr},
Expr,
},
};
Expand All @@ -29,8 +29,8 @@ pub(crate) struct ErrorInvalidJumpGadget<F> {
is_code: Cell<F>,
is_jump_dest: IsEqualGadget<F>,
is_jumpi: IsEqualGadget<F>,
condition: Word32Cell<F>,
is_condition_zero: IsZeroWordGadget<F, Word32Cell<F>>,
condition: WordCell<F>,
is_condition_zero: IsZeroWordGadget<F, WordCell<F>>,
common_error_gadget: CommonErrorGadget<F>,
}

Expand All @@ -46,7 +46,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorInvalidJumpGadget<F> {
let opcode = cb.query_cell();
let value = cb.query_cell();
let is_code = cb.query_cell();
let condition = cb.query_word32();
let condition = cb.query_word_unchecked();

cb.require_in_set(
"ErrorInvalidJump only happend in JUMP or JUMPI",
Expand Down

0 comments on commit 6bc88fe

Please sign in to comment.