At the moment the ProfileDataV3 stores the total consumed gas for each host function and action. This makes Compute Cost calculation harder than necessary because we need to divide the total consumed gas by the host function call before multiplying it by the corresponding compute cost.
We could simplify this by instead storing the call count for each ExtCost inside the profile as it can be used to derive both resulting gas usage and compute usage.
Relatedly, we also store a counter EXT_COSTS_COUNTER alongside GasCounter for the use in parameter estimator. We should consider whether it should be merged directly into GasCounter to eliminate duplication with Profiles that we track anyway unconditionally.
At the moment the
ProfileDataV3
stores the total consumed gas for each host function and action. This makes Compute Cost calculation harder than necessary because we need to divide the total consumed gas by the host function call before multiplying it by the corresponding compute cost.We could simplify this by instead storing the call count for each ExtCost inside the profile as it can be used to derive both resulting gas usage and compute usage.
Relatedly, we also store a counter
EXT_COSTS_COUNTER
alongsideGasCounter
for the use in parameter estimator. We should consider whether it should be merged directly intoGasCounter
to eliminate duplication with Profiles that we track anyway unconditionally.