File tree Expand file tree Collapse file tree 6 files changed +29
-13
lines changed Expand file tree Collapse file tree 6 files changed +29
-13
lines changed Original file line number Diff line number Diff 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 " }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ( ) {
Original file line number Diff line number Diff line change 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 ) )
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 }
Original file line number Diff line number Diff 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 ! [
You can’t perform that action at this time.
0 commit comments