Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/handler/src/pre_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ pub fn validate_against_state_and_deduct_caller<
is_nonce_check_disabled,
)?;

// Bump the nonce for calls. Nonce for CREATE will be bumped in `make_create_frame`.
if tx.kind().is_call() {
// Nonce is already checked
caller_account.info.nonce = caller_account.info.nonce.saturating_add(1);
}

let max_balance_spending = tx.max_balance_spending()?;

// Check if account has enough balance for `gas_limit * max_fee`` and value transfer.
Expand Down Expand Up @@ -178,6 +172,12 @@ pub fn validate_against_state_and_deduct_caller<
caller_account.mark_touch();
caller_account.info.balance = new_balance;

// Bump the nonce for calls. Nonce for CREATE will be bumped in `make_create_frame`.
if tx.kind().is_call() {
// Nonce is already checked
caller_account.info.nonce = caller_account.info.nonce.saturating_add(1);
}

journal.caller_accounting_journal_entry(tx.caller(), old_balance, tx.kind().is_call());
Ok(())
}
Expand Down
10 changes: 5 additions & 5 deletions crates/op-revm/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ where
)?;
}

// Bump the nonce for calls. Nonce for CREATE will be bumped in `handle_create`.
if tx.kind().is_call() {
caller_account.info.nonce = caller_account.info.nonce.saturating_add(1);
}

let max_balance_spending = tx.max_balance_spending()?.saturating_add(additional_cost);

// old balance is journaled before mint is incremented.
Expand Down Expand Up @@ -210,6 +205,11 @@ where
caller_account.mark_touch();
caller_account.info.balance = new_balance;

// Bump the nonce for calls. Nonce for CREATE will be bumped in `handle_create`.
if tx.kind().is_call() {
caller_account.info.nonce = caller_account.info.nonce.saturating_add(1);
}

// NOTE: all changes to the caller account should journaled so in case of error
// we can revert the changes.
journal.caller_accounting_journal_entry(tx.caller(), old_balance, tx.kind().is_call());
Expand Down
Loading