Skip to main content

Gas Config

Guru Chain introduces two main changes in the chain's gas calculation:

  • Decrease the gas calculation for Cosmos transactions.
  • Allow the oracle daemon to dynamically reset the value of MinGasPrice

Gas Calculation

Setup

Default gas limit

const DefaultGasLimit = 25000

KVGasConfig

HasCost:          200,
DeleteCost: 200,
ReadCostFlat: 200,
ReadCostPerByte: 3,
WriteCostFlat: 400,
WriteCostPerByte: 6,
IterNextCostFlat: 6,

TransientGasConfig

HasCost:          200,
DeleteCost: 200,
ReadCostFlat: 200,
ReadCostPerByte: 2,
WriteCostFlat: 400,
WriteCostPerByte: 6,
IterNextCostFlat: 6,

Secp256k1VerifyCost

Secp256k1VerifyCost uint64 = 200

Results

  • Almost 5 times lower gasUsed calculation for all Cosmos transactions
  • Cosmos bank/msgSend gasUsed amount is similar to evm/Transfer transactions

Dynamic MinGasPrice

Guru chain stands out by maintaining the fiat-based constant transaction fees.

However, the native coin GXN is a volatile token where the price changes due to market. In oder to maintain the fiat-based constant value for the Guru transactions, oracle module constantly retreives the latest value of GXN token from maultiple external sources such as BEXs and DEXs. Based on the latest price of the GXN token, the value of MinGasPrice is also reset dynamically by oracled.