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
With #3956 we've updated the gas_scale parameter to allow for more flexibility when setting the minimum gas price for a given token. We might have the need for even more flexibility in the future but because of the fixed amount of decimal places for the tokens (6 for the native one, 0 for IBC tokens) and the need to keep the gas costs themselves at a minimum (~ 10k-1M gas units, to avoid squishing them too much), the current logic would not allow it.
If this scenario ever came up we should rework the way we define the gas used by transactions and the minimum costs:
The minimum gas prices should be DenominatedAmounts (even in storage, right now we convert them to Amounts) with an arbitrary denomination, so that we are not limited by the actual denomination of the specific token
At genesis we should avoid checking the validity of this denomination in the genesis file since it could be lower than the actual denomination of the token
When we fo the checks in protocol to validate the gas price declared by a transaction we should use DenominatedAmounts instead of Amounts
In the SDK we should account for this denomination when validating the gas cost of the tx
When computing the gas cost that the tx signer has to pay, we must multiply this denominated amount by the gas limit and ceil the result to the closer valid denomination for the gas token
Given that we might be able to remove the gas_scale param altogether.
Since we are already at it, we should avoid increasing the gas cost of non-wasm operations by removing the GAS_COST_CORRECTION constant:
With #3956 we've updated the
gas_scale
parameter to allow for more flexibility when setting the minimum gas price for a given token. We might have the need for even more flexibility in the future but because of the fixed amount of decimal places for the tokens (6 for the native one, 0 for IBC tokens) and the need to keep the gas costs themselves at a minimum (~ 10k-1M gas units, to avoid squishing them too much), the current logic would not allow it.If this scenario ever came up we should rework the way we define the gas used by transactions and the minimum costs:
DenominatedAmount
s (even in storage, right now we convert them toAmount
s) with an arbitrary denomination, so that we are not limited by the actual denomination of the specific tokenDenominatedAmount
s instead ofAmount
sGiven that we might be able to remove the
gas_scale
param altogether.Since we are already at it, we should avoid increasing the gas cost of non-wasm operations by removing the
GAS_COST_CORRECTION
constant:namada/crates/gas/src/lib.rs
Line 134 in a148ac3
and we should instead reduce the gas cost of the single wasm opcodes by the same ratio.
The text was updated successfully, but these errors were encountered: