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
20 changes: 16 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ solang-parser = "=0.3.1"
#ethers-solc = { path = "../ethers-rs/ethers-solc" }

[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm/", rev = "14787244394c46e49ca59e32d7de1ebc95e66892" }
revm = { git = "https://github.com/bluealloy/revm/", rev = "bc4d203bf0b5f5c01868477c8e98d3abd6bb92ab" }
2 changes: 1 addition & 1 deletion anvil/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl From<GenesisAccount> for AccountInfo {
AccountInfo {
balance: balance.into(),
nonce: nonce.unwrap_or_default(),
code_hash: code.as_ref().map(|code| code.hash()).unwrap_or(KECCAK_EMPTY),
code_hash: code.as_ref().map(|code| code.hash_slow()).unwrap_or(KECCAK_EMPTY),
code,
}
}
Expand Down
8 changes: 6 additions & 2 deletions evm/src/executor/fork/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,12 @@ impl MemDb {
storage.remove(&add);
} else {
// insert account
if let Some(code_hash) =
acc.info.code.as_ref().filter(|code| !code.is_empty()).map(|code| code.hash())
if let Some(code_hash) = acc
.info
.code
.as_ref()
.filter(|code| !code.is_empty())
.map(|code| code.hash_slow())
{
acc.info.code_hash = code_hash;
} else if acc.info.code_hash.is_zero() {
Expand Down
8 changes: 4 additions & 4 deletions evm/src/executor/inspector/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ where
interpreter: &mut Interpreter,
_: &mut EVMData<'_, DB>,
) -> InstructionResult {
self.maps.entry(b256_to_h256(interpreter.contract.bytecode.hash())).or_insert_with(|| {
let hash = b256_to_h256(interpreter.contract.bytecode.clone().unlock().hash_slow());
self.maps.entry(hash).or_insert_with(|| {
HitMap::new(Bytes::copy_from_slice(
interpreter.contract.bytecode.original_bytecode_slice(),
))
Expand All @@ -37,9 +38,8 @@ where
interpreter: &mut Interpreter,
_: &mut EVMData<'_, DB>,
) -> InstructionResult {
self.maps
.entry(b256_to_h256(interpreter.contract.bytecode.hash()))
.and_modify(|map| map.hit(interpreter.program_counter()));
let hash = b256_to_h256(interpreter.contract.bytecode.clone().unlock().hash_slow());
self.maps.entry(hash).and_modify(|map| map.hit(interpreter.program_counter()));

InstructionResult::Continue
}
Expand Down
2 changes: 1 addition & 1 deletion evm/src/fuzz/strategies/param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ mod tests {
let f = "function testArray(uint64[2] calldata values)";
let func = HumanReadableParser::parse_function(f).unwrap();

let db = CacheDB::new(EmptyDB());
let db = CacheDB::new(EmptyDB::default());
let state = build_initial_state(&db, &FuzzDictionaryConfig::default());

let strat = proptest::strategy::Union::new_weighted(vec![
Expand Down