Skip to content

Commit 56b806a

Browse files
authored
chore: lookup codehash locally (#11060)
1 parent 6a8410e commit 56b806a

File tree

1 file changed

+3
-0
lines changed
  • crates/anvil/src/eth/backend/mem

1 file changed

+3
-0
lines changed

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,6 +2600,9 @@ impl Backend {
26002600
code_hash: B256,
26012601
block_id: Option<BlockId>,
26022602
) -> Result<Option<Bytes>, BlockchainError> {
2603+
if let Ok(code) = self.db.read().await.code_by_hash_ref(code_hash) {
2604+
return Ok(Some(code.original_bytes()));
2605+
}
26032606
if let Some(fork) = self.get_fork() {
26042607
return Ok(fork.debug_code_by_hash(code_hash, block_id).await?);
26052608
}

0 commit comments

Comments
 (0)