Skip to content

Commit 8b6ab31

Browse files
authored
feat(revm): revert EIP-2935 BLOCKHASH opcode changes (#1450)
* feat(revm): revert EIP-2935 BLOCKHASH opcode changes * fix lint * bump time * return previous impl mod prague branch * remove unused imports
1 parent 0e1cd99 commit 8b6ab31

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

crates/revm/src/context.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ use revm_interpreter::as_usize_saturated;
1313
use crate::{
1414
db::{Database, EmptyDB},
1515
interpreter::{Host, LoadAccountResult, SStoreResult, SelfDestructResult},
16-
primitives::{
17-
Address, Bytecode, EVMError, Env, HandlerCfg, Log, B256, BLOCKHASH_SERVE_WINDOW,
18-
BLOCKHASH_STORAGE_ADDRESS, BLOCK_HASH_HISTORY, PRAGUE, U256,
19-
},
16+
primitives::{Address, Bytecode, Env, HandlerCfg, Log, B256, BLOCK_HASH_HISTORY, U256},
2017
};
2118
use std::boxed::Box;
2219

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

133-
if self.evm.journaled_state.spec.is_enabled_in(PRAGUE) && diff <= BLOCKHASH_SERVE_WINDOW {
134-
let index = number.wrapping_rem(U256::from(BLOCKHASH_SERVE_WINDOW));
135-
return self
136-
.evm
137-
.db
138-
.storage(BLOCKHASH_STORAGE_ADDRESS, index)
139-
.map_err(|e| self.evm.error = Err(EVMError::Database(e)))
140-
.ok()
141-
.map(|v| v.into());
142-
}
143-
144130
Some(B256::ZERO)
145131
}
146132

0 commit comments

Comments
 (0)