-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-evaluate the necessity for all the contract cost types before testnet #981
Comments
Questionable types based on above criteria:
|
ChargeBudget Should be removed. Why:It is a small constant call that cannot happen recursively or in bulk -- fails the significance check. It was originally included mainly because of metering of wasm instructions. Original comment:
The worry was (based on my understanding of what @graydon wrote), if we charge wasm instruction too granularly, we would be calling This is no longer the case. Now wasm instruction metering happens on the wasmi side and we are only charging the budget when crossing the host<->guest boundaries. No other cost types can charge budget excessively. (Note: one interesting potentially useful information being removed is how many times the meter was called. We can add that information back as a new field in the |
Why:Originally added mainly for recursion prevension -- in case there is a nested val path where we didn't charge for. For normal non-object val, the conversion goes through env-common, and they are not charged (we cannot charge for it as they don't go through the host). Those are just 8 bytes copy so they are okay. We charge for anything that involves the host object. So in Does this satisfy the "ubiquity" criteria?One could argue
|
The contract cost types were created since the beginning of Soroban to represent metering components of the Soroban host.
The cost definitions has undergone many iterations and currently these 31 cost types encompasses all the metering components. This issue is to reevaluate all the definitions to make them "testnet finalized".
Here are the list of criteria for the existence of a cost type (in accordance with the metering CAP):
a. has either linear or large constant cost in either of {cpu, mem} dimensions
b. or if the cost is a small constant, it can happen in high frequency
c. the existence threshold for a constant cost is the cost of
ChargeBudget
(~100 cpu insns)The text was updated successfully, but these errors were encountered: