Closed Eagle941 closed 5 months ago
It should be possible to use the CachedState
object because it has the field visited_pcs
.
Using CachedState
is not possible because the visited_pcs
is contained in a HashSet
instead of a slice, therefore insertion order isn't guaranteed
Converting visited_pcs
to Vec
ensures order. Running test suite on pathfinder
and blockifier
doesn't lead to any failure. This makes visited_pcs
of type HashMap<ClassHash, Vec<usize>>
where usize
is the value of pc
from TraceEntry
.
The problem of this method is that when a contract is invoked, other contracts can be invoked. This implies that if the same contract is called multiple times in a transaction, the list of pc
s is extended in the HashMap
losing track of the pc
s for each entry point call.
The new type of visited_pcs
is HashMap<ClassHash, Vec<Vec<usize>>>
.
This issue concerns how to extract the
Trace
list object from inside the transaction execution inblockifier
crate for consumption by the profiler object. TheTrace
list contains the series ofpc
s for each execution step in the virtual machine. Usepathfinder
node.