Skip to content

Commit

Permalink
feat(revm): revert EIP-2935 BLOCKHASH opcode changes (#1450)
Browse files Browse the repository at this point in the history
* feat(revm): revert EIP-2935 BLOCKHASH opcode changes

* fix lint

* bump time

* return previous impl mod prague branch

* remove unused imports
  • Loading branch information
shekhirin authored May 24, 2024
1 parent 0e1cd99 commit 8b6ab31
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions crates/revm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ use revm_interpreter::as_usize_saturated;
use crate::{
db::{Database, EmptyDB},
interpreter::{Host, LoadAccountResult, SStoreResult, SelfDestructResult},
primitives::{
Address, Bytecode, EVMError, Env, HandlerCfg, Log, B256, BLOCKHASH_SERVE_WINDOW,
BLOCKHASH_STORAGE_ADDRESS, BLOCK_HASH_HISTORY, PRAGUE, U256,
},
primitives::{Address, Bytecode, Env, HandlerCfg, Log, B256, BLOCK_HASH_HISTORY, U256},
};
use std::boxed::Box;

Expand Down Expand Up @@ -130,17 +127,6 @@ impl<EXT, DB: Database> Host for Context<EXT, DB> {
.ok();
}

if self.evm.journaled_state.spec.is_enabled_in(PRAGUE) && diff <= BLOCKHASH_SERVE_WINDOW {
let index = number.wrapping_rem(U256::from(BLOCKHASH_SERVE_WINDOW));
return self
.evm
.db
.storage(BLOCKHASH_STORAGE_ADDRESS, index)
.map_err(|e| self.evm.error = Err(EVMError::Database(e)))
.ok()
.map(|v| v.into());
}

Some(B256::ZERO)
}

Expand Down

0 comments on commit 8b6ab31

Please sign in to comment.