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

fix: pre EIP-7702 does not need to load code #50

Draft
wants to merge 1 commit into
base: scroll-evm-executor/feat/v55/euclid-v2
Choose a base branch
from
Draft
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
11 changes: 10 additions & 1 deletion crates/revm/src/journaled_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,15 @@ impl JournaledState {
db: &mut DB,
) -> Result<AccountLoad, EVMError<DB::Error>> {
let spec = self.spec;
let account = self.load_code(address, db)?;
#[cfg(not(feature = "scroll"))]
let eip7702_enabled = spec_id.is_enabled_in(SpecId::PRAGUE);
#[cfg(feature = "scroll")]
let eip7702_enabled = spec.is_enabled_in(SpecId::EUCLID_V2);
let account = if eip7702_enabled {
self.load_code(address, db)?
} else {
self.load_account(address, db)?
};
let is_empty = account.state_clear_aware_is_empty(spec);

let mut account_load = AccountLoad {
Expand Down Expand Up @@ -672,6 +680,7 @@ impl JournaledState {
) -> Result<StateLoad<&mut Account>, EVMError<DB::Error>> {
let account_load = self.load_account(address, db)?;
let acc = &mut account_load.data.info;
println!("acc = {:?}", acc);
if acc.code.is_none() {
if acc.code_hash == KECCAK_EMPTY {
let empty = Bytecode::default();
Expand Down
Loading