From 3e4edef089bea062362692ebd519e08d8082bc36 Mon Sep 17 00:00:00 2001 From: kunxian xia Date: Tue, 11 Jul 2023 20:55:57 +0800 Subject: [PATCH] fix finding 21 --- zkevm-circuits/src/tx_circuit.rs | 12 ++++++------ zkevm-circuits/src/witness/tx.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/zkevm-circuits/src/tx_circuit.rs b/zkevm-circuits/src/tx_circuit.rs index a03b08c35c..8f4a44b2d8 100644 --- a/zkevm-circuits/src/tx_circuit.rs +++ b/zkevm-circuits/src/tx_circuit.rs @@ -1714,12 +1714,6 @@ impl TxCircuit { Some(tx.nonce == 0), Value::known(F::from(tx.nonce)), ), - ( - Gas, - Some(Tag::Gas.into()), - Some(tx.gas == 0), - Value::known(F::from(tx.gas)), - ), ( GasPrice, Some(Tag::GasPrice.into()), @@ -1728,6 +1722,12 @@ impl TxCircuit { .evm_word() .map(|challenge| rlc(tx.gas_price.to_le_bytes(), challenge)), ), + ( + Gas, + Some(Tag::Gas.into()), + Some(tx.gas == 0), + Value::known(F::from(tx.gas)), + ), ( CallerAddress, Some(Tag::Sender.into()), diff --git a/zkevm-circuits/src/witness/tx.rs b/zkevm-circuits/src/witness/tx.rs index 6205353155..05bab982f2 100644 --- a/zkevm-circuits/src/witness/tx.rs +++ b/zkevm-circuits/src/witness/tx.rs @@ -170,12 +170,6 @@ impl Transaction { Value::known(F::zero()), Value::known(F::from(self.nonce)), ], - [ - Value::known(F::from(self.id as u64)), - Value::known(F::from(TxContextFieldTag::Gas as u64)), - Value::known(F::zero()), - Value::known(F::from(self.gas)), - ], [ Value::known(F::from(self.id as u64)), Value::known(F::from(TxContextFieldTag::GasPrice as u64)), @@ -184,6 +178,12 @@ impl Transaction { .evm_word() .map(|challenge| rlc::value(&self.gas_price.to_le_bytes(), challenge)), ], + [ + Value::known(F::from(self.id as u64)), + Value::known(F::from(TxContextFieldTag::Gas as u64)), + Value::known(F::zero()), + Value::known(F::from(self.gas)), + ], [ Value::known(F::from(self.id as u64)), Value::known(F::from(TxContextFieldTag::CallerAddress as u64)),