Wayfinding
-
Cosmos SDK Gas Metering
One challenge of implementing Monomer is creating a standard for how gas is metered and handled. By metered we mean both tracked and calculated. By handled we mean how fees are checked and ultimately deducted.
On the Monomer side, the problem we want to solve is two-fold:
- Exempting the first transaction of every block from gas fees (the first tx in each block are Layer-1 deposits).
- Translating the gas limit from the Engine API’s
PayloadAttributesto the Cosmos SDK.
To tackle this problem, we need to take a step back and understand how gas is handled in the Cosmos SDK; first at a high-level, and then at a more granular implementation-level.