Clear up estimations around function call costs #6353
Labels
A-params-estimator
Area: runtime params estimator
T-contract-runtime
Team: issues relevant to the contract runtime team
@matklad @Longarithm @olonho
I think there are several things mixed up in our function call estimations. I will write down my current understanding and we can have a discussion in the comments if anyone thinks I got it wrong.
How we charge a function call
The current cost model for function calls charges the following items:
action_creation_config.function_call_cost
bytes in method name
+bytes in arguments
) *action_creation_config.function_call_cost_per_byte
ext_costs.contract_compile_base
bytes in contract
*ext_costs.contract_compile_bytes
How we estimate function call costs
The current estimations differs from this model in a few ways.
ActionFunctionCallBase
andActionFunctionCallPerByte
include the loading cost for a test contractActionFunctionCallBaseV2
andActionFunctionCallPerByteV2
Items that need to be fixed
ActionFunctionCallBase
andActionFunctionCallPerByte
estimations to only cover action creation costActionFunctionCallBaseV2
andActionFunctionCallPerByteV2
. They already estimate almost exactly what we want to callcontract_loading
cost once protocol_feature_fix_contract_loading_cost tracking issue #5962 is done.Edit: Removed references to ext_cost.base, which I just misunderstood.
The text was updated successfully, but these errors were encountered: