From 33daa09206357af131cbedd6236cb6c75b2b2b50 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Fri, 21 Apr 2023 12:53:49 +0800 Subject: [PATCH] nonce/gas_limit to u64 --- zkevm-circuits/src/evm_circuit/param.rs | 4 ++-- zkevm-circuits/src/instance.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zkevm-circuits/src/evm_circuit/param.rs b/zkevm-circuits/src/evm_circuit/param.rs index c06b2a740e5..2b6e7a1bad1 100644 --- a/zkevm-circuits/src/evm_circuit/param.rs +++ b/zkevm-circuits/src/evm_circuit/param.rs @@ -128,8 +128,8 @@ pub(crate) const N_BYTES_BLOCK: usize = N_BYTES_COINBASE pub(crate) const N_BYTES_EXTRA_VALUE: usize = N_BYTES_WORD + N_BYTES_WORD; // Number of bytes that will be used for tx values -pub(crate) const N_BYTES_TX_NONCE: usize = N_BYTES_WORD; -pub(crate) const N_BYTES_TX_GAS_LIMIT: usize = N_BYTES_WORD; // gas limit type is U256, different with gas U64 +pub(crate) const N_BYTES_TX_NONCE: usize = N_BYTES_U64; +pub(crate) const N_BYTES_TX_GAS_LIMIT: usize = N_BYTES_U64; // gas limit type is U256, different with gas U64 pub(crate) const N_BYTES_TX_GASPRICE: usize = N_BYTES_WORD; pub(crate) const N_BYTES_TX_FROM: usize = N_BYTES_ACCOUNT_ADDRESS; pub(crate) const N_BYTES_TX_TO: usize = N_BYTES_ACCOUNT_ADDRESS; diff --git a/zkevm-circuits/src/instance.rs b/zkevm-circuits/src/instance.rs index b7c25860c83..39fd4b71042 100644 --- a/zkevm-circuits/src/instance.rs +++ b/zkevm-circuits/src/instance.rs @@ -40,9 +40,9 @@ pub struct BlockValues { #[derive(Default, Debug, Clone)] pub struct TxValues { /// nonce - pub nonce: Word, + pub nonce: u64, /// gas_limit - pub gas_limit: Word, + pub gas_limit: u64, /// gas_price pub gas_price: Word, /// from_addr @@ -139,9 +139,9 @@ impl PublicData { let mut msg_hash_le = [0u8; 32]; msg_hash_le.copy_from_slice(sign_data.msg_hash.to_bytes().as_slice()); tx_vals.push(TxValues { - nonce: tx.nonce, + nonce: tx.nonce.low_u64(), gas_price: tx.gas_price, - gas_limit: tx.gas_limit, + gas_limit: tx.gas_limit.low_u64(), from_addr: tx.from, to_addr: tx.to.unwrap_or_else(Address::zero), is_create: (tx.to.is_none() as u64),