Skip to content

Commit

Permalink
nonce can skip
Browse files Browse the repository at this point in the history
  • Loading branch information
lispc committed Aug 7, 2023
1 parent 4748be6 commit 8b29f74
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bus-mapping/src/evm/opcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,18 +547,19 @@ pub fn gen_begin_tx_ops(
}

// Increase caller's nonce
let mut nonce_prev = state.sdb.get_account(&caller_address).1.nonce;
debug_assert!(nonce_prev <= state.tx.nonce.into());
while nonce_prev < state.tx.nonce.into() {
nonce_prev = state.sdb.increase_nonce(&caller_address).into();
let mut nonce_prev = state.sdb.get_nonce(&caller_address);
debug_assert!(nonce_prev <= state.tx.nonce);
while nonce_prev < state.tx.nonce {
state.sdb.increase_nonce(&caller_address);
nonce_prev = state.sdb.get_nonce(&caller_address);
log::warn!("[debug] increase nonce to {}", nonce_prev);
}
state.account_write(
&mut exec_step,
caller_address,
AccountField::Nonce,
nonce_prev + 1,
nonce_prev,
(nonce_prev + 1).into(),
nonce_prev.into(),
)?;

// Add precompile contract address to access list
Expand Down

0 comments on commit 8b29f74

Please sign in to comment.