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

Commit

Permalink
rename zero_f to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihChengLiang committed Feb 1, 2024
1 parent ee06c29 commit f5a98f2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions zkevm-circuits/src/mpt_circuit/account_leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,10 @@ impl<F: Field> AccountLeafConfig<F> {

// Key
let mut key_rlc = vec![0.scalar(); 2];
let mut nonce = vec![Word::zero_f(); 2];
let mut balance = vec![Word::zero_f(); 2];
let mut storage = vec![Word::zero_f(); 2];
let mut codehash = vec![Word::zero_f(); 2];
let mut nonce = vec![Word::zero(); 2];
let mut balance = vec![Word::zero(); 2];
let mut storage = vec![Word::zero(); 2];
let mut codehash = vec![Word::zero(); 2];
let mut key_data = vec![KeyDataWitness::default(); 2];
let mut parent_data = vec![ParentDataWitness::default(); 2];
for is_s in [true, false] {
Expand Down Expand Up @@ -671,11 +671,11 @@ impl<F: Field> AccountLeafConfig<F> {
} else if is_codehash_mod {
(MPTProofType::CodeHashChanged, codehash)
} else if is_account_delete_mod {
(MPTProofType::AccountDestructed, vec![Word::zero_f(); 2])
(MPTProofType::AccountDestructed, vec![Word::zero(); 2])
} else if is_non_existing_proof {
(MPTProofType::AccountDoesNotExist, vec![Word::zero_f(); 2])
(MPTProofType::AccountDoesNotExist, vec![Word::zero(); 2])
} else {
(MPTProofType::Disabled, vec![Word::zero_f(); 2])
(MPTProofType::Disabled, vec![Word::zero(); 2])
};

if account.is_mod_extension[0] || account.is_mod_extension[1] {
Expand All @@ -689,7 +689,7 @@ impl<F: Field> AccountLeafConfig<F> {

let mut new_value = value[false.idx()];
if parent_data[false.idx()].is_placeholder {
new_value = word::Word::zero_f();
new_value = word::Word::zero();
}
mpt_config.mpt_table.assign_cached(
region,
Expand All @@ -698,7 +698,7 @@ impl<F: Field> AccountLeafConfig<F> {
address: Value::known(from_bytes::value(
&account.address.iter().cloned().rev().collect::<Vec<_>>(),
)),
storage_key: word::Word::zero_f().into_value(),
storage_key: word::Word::zero().into_value(),
proof_type: Value::known(proof_type.scalar()),
new_root: main_data.new_root.into_value(),
old_root: main_data.old_root.into_value(),
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/mpt_circuit/branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl<F: Field> BranchGadget<F> {
let key_mult_post_branch = *key_mult * mult;

// Set the branch we'll take
let mut mod_node_hash_word = [word::Word::zero_f(); 2];
let mut mod_node_hash_word = [word::Word::zero(); 2];
let mut mod_node_hash_rlc = [0.scalar(); 2];
for is_s in [true, false] {
(
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/mpt_circuit/extension_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl<F: Field> ExtensionBranchConfig<F> {
mod_node_hash_rlc[is_s.idx()],
false,
false,
Word::zero_f(),
Word::zero(),
)?;
} else {
KeyData::witness_store(
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/mpt_circuit/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<F: Field> StartConfig<F> {
self.proof_type
.assign(region, offset, start.proof_type.scalar())?;

let mut root = vec![Word::zero_f(); 2];
let mut root = vec![Word::zero(); 2];
for is_s in [true, false] {
root[is_s.idx()] = rlp_values[is_s.idx()].word();
}
Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/mpt_circuit/storage_leaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl<F: Field> StorageLeafConfig<F> {
let mut key_data = vec![KeyDataWitness::default(); 2];
let mut parent_data = vec![ParentDataWitness::default(); 2];
let mut key_rlc = vec![0.scalar(); 2];
let mut value_word = vec![Word::zero_f(); 2];
let mut value_word = vec![Word::zero(); 2];
for is_s in [true, false] {
self.is_mod_extension[is_s.idx()].assign(
region,
Expand Down Expand Up @@ -532,7 +532,7 @@ impl<F: Field> StorageLeafConfig<F> {

let mut new_value = value_word[false.idx()];
if parent_data[false.idx()].is_placeholder {
new_value = word::Word::zero_f();
new_value = word::Word::zero();
}
mpt_config.mpt_table.assign_cached(
region,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/util/word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl<F: Field, T: Expr<F> + Clone> WordExpr<F> for Word<T> {

impl<F: Field> Word<F> {
/// zero word
pub fn zero_f() -> Self {
pub fn zero() -> Self {
Self::new([F::ZERO, F::ZERO])
}

Expand Down

0 comments on commit f5a98f2

Please sign in to comment.