Estimation functions for fundamental unit helper-costs #5991
Labels
A-params-estimator
Area: runtime params estimator
T-contract-runtime
Team: issues relevant to the contract runtime team
Inside
runtime-params-estimator/src/cost.rs
we have oneCost
entry for each estimation. Some are for specific runtime parameters. Others do not have such a direct relation but we still want to estimate and track them. Let's call the first group parameter-costs and the second group helper-costs.This issue is about these specific helper-costs:
OneCPUInstruction
(this is x86, notWasmInstruction
)OneNanosecond
IoReadByte
andIoWriteByte
(Not to be confused withStorageReadByte
and friends. IO costs are bytes at physical disk level and storage bytes are at the Wasm runtime layer)The idea is that they can be used to evaluate the currently used constants in
runtime-params-estimator/src/estimator_params.rs
on specific hardware. These fundamental constants are used in the gas formula for parameter-costs and helper-costs. Thus, it is crucial that we have accurate values here, or otherwise all estimations are inaccurate.On a theoretical reference hardware, the new estimations should confirm those constants exactly. Any strong outliers (above or below) on real hardware means that our estimator is not well tuned for that hardware.
Implementation
As of now, I am not 100% sure how to implement these estimation functions. I think all of them will need to execute a larger amount of computation and then divide it to receive an average for the smallest unit. But beyond that, there are several open questions:
The text was updated successfully, but these errors were encountered: