Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: push NonceChange to Journal in deduct_caller #1804

Merged
merged 1 commit into from
Sep 25, 2024
Merged
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
16 changes: 15 additions & 1 deletion crates/revm/src/handler/mainnet/pre_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! They handle initial setup of the EVM, call loop and the final return of the EVM

use crate::{Context, ContextPrecompiles, EvmWiring};
use crate::{Context, ContextPrecompiles, EvmWiring, JournalEntry};
use bytecode::Bytecode;
use precompile::PrecompileSpecId;
use primitives::{BLOCKHASH_STORAGE_ADDRESS, U256};
Expand Down Expand Up @@ -105,6 +105,20 @@ pub fn deduct_caller<EvmWiringT: EvmWiring, SPEC: Spec>(
// deduct gas cost from caller's account.
deduct_caller_inner::<EvmWiringT, SPEC>(caller_account.data, &context.evm.inner.env);

// Ensure tx kind is call
if context.evm.inner.env.tx.kind().is_call() {
// Push NonceChange entry
context
.evm
.inner
.journaled_state
.journal
.last_mut()
.unwrap()
.push(JournalEntry::NonceChange {
address: *context.evm.inner.env.tx.caller(),
});
}
Ok(())
}

Expand Down
Loading