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

Commit

Permalink
nonce/gas_limit to u64
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Apr 21, 2023
1 parent b891356 commit 33daa09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions zkevm-circuits/src/evm_circuit/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions zkevm-circuits/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 33daa09

Please sign in to comment.