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

Commit

Permalink
Better name query_advice
Browse files Browse the repository at this point in the history
  • Loading branch information
leolara committed Jun 21, 2023
1 parent 33a0c1c commit 8b8ea05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 9 additions & 5 deletions zkevm-circuits/src/bytecode_circuit/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl<F: Field> SubCircuitConfig<F> for BytecodeCircuitConfig<F> {

cb.require_equal_word(
"assert cur.hash == EMPTY_HASH",
bytecode_table.code_hash.query(meta, Rotation::cur()),
bytecode_table.code_hash.query_advice(meta, Rotation::cur()),
empty_hash_word,
);

Expand Down Expand Up @@ -322,8 +322,10 @@ impl<F: Field> SubCircuitConfig<F> for BytecodeCircuitConfig<F> {

cb.require_equal_word(
"next.hash == cur.hash",
bytecode_table.code_hash.query(meta, Rotation::next()),
bytecode_table.code_hash.query(meta, Rotation::cur()),
bytecode_table
.code_hash
.query_advice(meta, Rotation::next()),
bytecode_table.code_hash.query_advice(meta, Rotation::cur()),
);

cb.require_equal(
Expand Down Expand Up @@ -365,8 +367,10 @@ impl<F: Field> SubCircuitConfig<F> for BytecodeCircuitConfig<F> {

cb.require_equal_word(
"next.hash == cur.hash",
bytecode_table.code_hash.query(meta, Rotation::next()),
bytecode_table.code_hash.query(meta, Rotation::cur()),
bytecode_table
.code_hash
.query_advice(meta, Rotation::next()),
bytecode_table.code_hash.query_advice(meta, Rotation::cur()),
);

cb.require_equal(
Expand Down
10 changes: 7 additions & 3 deletions zkevm-circuits/src/util/word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<T, const N: usize> WordLimbs<T, N> {

impl<const N: usize> WordLimbs<Column<Advice>, N> {
/// Query advice of WordLibs of columns advice
pub fn query<F: Field>(
pub fn query_advice<F: Field>(
&self,
meta: &mut VirtualCells<F>,
at: Rotation,
Expand Down Expand Up @@ -393,8 +393,12 @@ impl<F: Field> Word<Value<F>> {

impl Word<Column<Advice>> {
/// Query advice of Word of columns advice
pub fn query<F: Field>(&self, meta: &mut VirtualCells<F>, at: Rotation) -> Word<Expression<F>> {
self.0.query(meta, at).to_word()
pub fn query_advice<F: Field>(
&self,
meta: &mut VirtualCells<F>,
at: Rotation,
) -> Word<Expression<F>> {
self.0.query_advice(meta, at).to_word()
}
}

Expand Down

0 comments on commit 8b8ea05

Please sign in to comment.