From 711f77489014cf104f9a8176a6691910a0df6724 Mon Sep 17 00:00:00 2001 From: Miha Stopar Date: Thu, 1 Feb 2024 10:13:02 +0100 Subject: [PATCH] Word::zero() used --- .../src/mpt_circuit/account_leaf.rs | 20 +++++++++---------- .../src/mpt_circuit/storage_leaf.rs | 12 +++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/zkevm-circuits/src/mpt_circuit/account_leaf.rs b/zkevm-circuits/src/mpt_circuit/account_leaf.rs index 43ff136b563..1f0c979b3c2 100644 --- a/zkevm-circuits/src/mpt_circuit/account_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/account_leaf.rs @@ -149,10 +149,10 @@ impl AccountLeafConfig { require!(config.main_data.is_below_account => false); let mut key_rlc = vec![0.expr(); 2]; - let mut nonce = vec![Word::>::new([0.expr(), 0.expr()]); 2]; - let mut balance = vec![Word::>::new([0.expr(), 0.expr()]); 2]; - let mut storage = vec![Word::>::new([0.expr(), 0.expr()]); 2]; - let mut codehash = vec![Word::>::new([0.expr(), 0.expr()]); 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 leaf_no_key_rlc = vec![0.expr(); 2]; let mut leaf_no_key_rlc_mult = vec![0.expr(); 2]; let mut value_list_num_bytes = vec![0.expr(); 2]; @@ -471,7 +471,7 @@ impl AccountLeafConfig { &mut cb.base, address.clone(), proof_type.clone(), - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), config.main_data.new_root.expr(), config.main_data.old_root.expr(), Word::>::new([new_value_lo, new_value_hi]), @@ -485,11 +485,11 @@ impl AccountLeafConfig { &mut cb.base, address.clone(), proof_type.clone(), - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), config.main_data.new_root.expr(), config.main_data.old_root.expr(), - Word::>::new([0.expr(), 0.expr()]), - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), + Word::zero(), ); }}; } elsex { @@ -503,10 +503,10 @@ impl AccountLeafConfig { &mut cb.base, address, proof_type, - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), config.main_data.new_root.expr(), config.main_data.old_root.expr(), - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), Word::>::new([old_value_lo, old_value_hi]), ); }}; diff --git a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs index 17a82d96abc..9c81f3403ba 100644 --- a/zkevm-circuits/src/mpt_circuit/storage_leaf.rs +++ b/zkevm-circuits/src/mpt_circuit/storage_leaf.rs @@ -104,7 +104,7 @@ impl StorageLeafConfig { require!(config.main_data.is_below_account => true); let mut key_rlc = vec![0.expr(); 2]; - let mut value_word = vec![Word::>::new([0.expr(), 0.expr()]); 2]; + let mut value_word = vec![Word::zero(); 2]; let mut value_rlp_rlc = vec![0.expr(); 2]; let mut value_rlp_rlc_mult = vec![0.expr(); 2]; @@ -246,11 +246,11 @@ impl StorageLeafConfig { ParentData::store( cb, &mut ctx.memory[parent_memory(is_s)], - word::Word::>::new([0.expr(), 0.expr()]), + Word::zero(), 0.expr(), true.expr(), false.expr(), - word::Word::>::new([0.expr(), 0.expr()]), + Word::zero(), ); } @@ -377,8 +377,8 @@ impl StorageLeafConfig { address_item.word(), config.main_data.new_root.expr(), config.main_data.old_root.expr(), - Word::>::new([0.expr(), 0.expr()]), - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), + Word:zero(), ); }}; } elsex { @@ -395,7 +395,7 @@ impl StorageLeafConfig { address_item.word(), config.main_data.new_root.expr(), config.main_data.old_root.expr(), - Word::>::new([0.expr(), 0.expr()]), + Word::zero(), value_word[true.idx()].clone(), ); }};