You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// DefaultGasMultiplier is how many cosmwasm gas points = 1 sdk gas point
// SDK reference costs can be found here: https://github.com/cosmos/cosmos-sdk/blob/02c6c9fafd58da88550ab4d7d494724a477c8a68/store/types/gas.go#L153-L164
// A write at ~3000 gas and ~200us = 10 gas per us (microsecond) cpu/io
// Rough timing have 88k gas at 90us, which is equal to 1k sdk gas... (one read)
//
// Please note that all gas prices returned to the wasmer engine should have this multiplied
DefaultGasMultiplieruint64=100
// DefaultInstanceCost is how much SDK gas we charge each time we load a WASM instance.
// Creating a new instance is costly, and this helps put a recursion limit to contracts calling contracts.
DefaultInstanceCostuint64=40_000
// DefaultCompileCost is how much SDK gas is charged *per byte* for compiling WASM code.
DefaultCompileCostuint64=2
// DefaultEventAttributeDataCost is how much SDK gas is charged *per byte* for attribute data in events.
// This is used with len(key) + len(value)
DefaultEventAttributeDataCostuint64=1
// DefaultContractMessageDataCost is how much SDK gas is charged *per byte* of the message that goes to the contract
// This is used with len(msg)
DefaultContractMessageDataCostuint64=1
// DefaultPerAttributeCost is how much SDK gas we charge per attribute count.
DefaultPerAttributeCostuint64=10
// DefaultPerCustomEventCost is how much SDK gas we charge per event count.
DefaultPerCustomEventCostuint64=20
// DefaultEventAttributeDataFreeTier number of bytes of total attribute data we do not charge.
DefaultEventAttributeDataFreeTier=100
)
I would also revisit some of the algorithms, like how the pricing works on Reply, which is a bit different charge for events than other items.
The text was updated successfully, but these errors were encountered:
Let's benchmark the default gas multiplier and the instantiate cost.
There is a new 1Terragas/ms definition for wasm gas. If we benchmark the secp256k1 sig verification (1000 sdk gas) we can find a proper conversion ratio there.
We can also benchmark non-cached instantiation and use the 1000 gas/sig verification comparison to get a proper number there.
And maybe even benchmark the compilation step and see if we want to make uploading code more expensive (this is done once per project, so not really an issue if this ends up as 10 million gas, real contracts will be worth that)
See the constants here. Many may warrant some adjustments. Especially the default gas multiplier.
wasmd/x/wasm/keeper/gas_register.go
Lines 11 to 36 in f6002fe
I would also revisit some of the algorithms, like how the pricing works on Reply, which is a bit different charge for events than other items.
The text was updated successfully, but these errors were encountered: