Skip to content

Commit 96345a2

Browse files
authored
chore: bump revm (foundry-rs#5592)
1 parent ad1d090 commit 96345a2

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

Cargo.lock

Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ solang-parser = "=0.3.1"
134134
#ethers-solc = { path = "../ethers-rs/ethers-solc" }
135135

136136
[patch.crates-io]
137-
revm = { git = "https://github.com/bluealloy/revm/", rev = "14787244394c46e49ca59e32d7de1ebc95e66892" }
137+
revm = { git = "https://github.com/bluealloy/revm/", rev = "bc4d203bf0b5f5c01868477c8e98d3abd6bb92ab" }

anvil/src/genesis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl From<GenesisAccount> for AccountInfo {
146146
AccountInfo {
147147
balance: balance.into(),
148148
nonce: nonce.unwrap_or_default(),
149-
code_hash: code.as_ref().map(|code| code.hash()).unwrap_or(KECCAK_EMPTY),
149+
code_hash: code.as_ref().map(|code| code.hash_slow()).unwrap_or(KECCAK_EMPTY),
150150
code,
151151
}
152152
}

evm/src/executor/fork/cache.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,12 @@ impl MemDb {
256256
storage.remove(&add);
257257
} else {
258258
// insert account
259-
if let Some(code_hash) =
260-
acc.info.code.as_ref().filter(|code| !code.is_empty()).map(|code| code.hash())
259+
if let Some(code_hash) = acc
260+
.info
261+
.code
262+
.as_ref()
263+
.filter(|code| !code.is_empty())
264+
.map(|code| code.hash_slow())
261265
{
262266
acc.info.code_hash = code_hash;
263267
} else if acc.info.code_hash.is_zero() {

evm/src/executor/inspector/coverage.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ where
2323
interpreter: &mut Interpreter,
2424
_: &mut EVMData<'_, DB>,
2525
) -> InstructionResult {
26-
self.maps.entry(b256_to_h256(interpreter.contract.bytecode.hash())).or_insert_with(|| {
26+
let hash = b256_to_h256(interpreter.contract.bytecode.clone().unlock().hash_slow());
27+
self.maps.entry(hash).or_insert_with(|| {
2728
HitMap::new(Bytes::copy_from_slice(
2829
interpreter.contract.bytecode.original_bytecode_slice(),
2930
))
@@ -37,9 +38,8 @@ where
3738
interpreter: &mut Interpreter,
3839
_: &mut EVMData<'_, DB>,
3940
) -> InstructionResult {
40-
self.maps
41-
.entry(b256_to_h256(interpreter.contract.bytecode.hash()))
42-
.and_modify(|map| map.hit(interpreter.program_counter()));
41+
let hash = b256_to_h256(interpreter.contract.bytecode.clone().unlock().hash_slow());
42+
self.maps.entry(hash).and_modify(|map| map.hit(interpreter.program_counter()));
4343

4444
InstructionResult::Continue
4545
}

evm/src/fuzz/strategies/param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ mod tests {
133133
let f = "function testArray(uint64[2] calldata values)";
134134
let func = HumanReadableParser::parse_function(f).unwrap();
135135

136-
let db = CacheDB::new(EmptyDB());
136+
let db = CacheDB::new(EmptyDB::default());
137137
let state = build_initial_state(&db, &FuzzDictionaryConfig::default());
138138

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

0 commit comments

Comments
 (0)