Gas and Fees
Learn about the differences between
Gas and Fees on Injective.Pre-requisite Readings → Cosmos SDK GasMinimum gas price: The minimum gas price set by validators is currently
160,000,000inj. To find the amount paid in inj, multiply the gas price by the gas amount and divide by 1e18 (INJ has 18 decimals).For example: if gasWanted is 104,519, then gasFees = 160,000,000 * 104,519 / 1e18 = 0.000016723injCosmos SDK Gas
In the Cosmos SDK, gas is tracked in the main GasMeter and the BlockGasMeter:
GasMeter: keeps track of the gas consumed during executions that lead to state transitions. It is reset on every transaction execution.BlockGasMeter: keeps track of the gas consumed in a block and enforces that the gas does not go over a predefined limit. This limit is defined in the Tendermint consensus parameters and can be changed via governance parameter change proposals.
BeginBlock and EndBlock operations and the AnteHandler checks, which might also read and write to the store before running the state transition from a transaction.
BeginBlock and EndBlock
These operations are defined by the Tendermint Core’s Application Blockchain Interface (ABCI) and are defined by each Cosmos SDK module. As their name suggest, they are executed at the beginning and at the end of each block processing respectively (i.e., pre- and post-transaction execution).
AnteHandler
The Cosmos SDK AnteHandler performs basic checks prior to transaction execution. These checks are usually signature verification, transaction field validation, transaction fees, etc.