feat(improvement
): identify contracts by hash, not bytecode
#9443
Labels
improvement
): identify contracts by hash, not bytecode
#9443
Component
Forge
Describe the feature you would like
We already collect coverage hitmaps by bytecode hash, we can use this to avoid the hacky heuristics of finding a matching artifact using the bytecode itself.
foundry/crates/forge/bin/cmd/coverage.rs
Line 253 in 7a23a5c
ContractsByArtifact::find_by*
foundry/crates/forge/bin/cmd/coverage.rs
Lines 254 to 260 in 7a23a5c
This also applies to all the other callsites of these functions, except for the
getArtifactPathBy[Deployed]Code
cheatcodes, where we would have to compute the hash ourselves.By computing the hashes of the bytecodes and looking up the artifacts by code hash, we will be able to get rid of the
find_by*code
functions altogether.cc @klkvr @grandizzy
Additional context
No response
The text was updated successfully, but these errors were encountered: