Transactions, Gas, and Fees

Purpose: Explain how the v0.16.0 ante handler routes Structs gameplay transactions and Cosmos staking transactions through a free-gas path while everything else continues to pay fees in ualpha.


TL;DR


What “free” actually means

Cosmos SDK ante decorators run before the message handler executes. Structs’s custom ante chain (app/ante/ante.go) inserts a GasRouterDecorator early in the chain that checks every incoming transaction:

  1. If IsFreeTransaction(msgs) – every message URL starts with /structs.structs.Msg AND none of them is MsgUpdateParams – the gas meter is replaced with a free meter capped at FreeGasCap (default 20_000_000).
  2. Else if IsFreeStakingTransaction(msgs) – every message URL is one of the six entries in FreeStakingMessages – the gas meter is replaced with a free meter capped at FreeStakingGasCap (default 40_000_000), and a per-address per-block throttle gates how many of these can land.
  3. Otherwise the standard SDK gas meter is used and fees flow through ConditionalMempoolFeeDecorator + ConditionalFeeDecorator, which behave like the upstream SDK fee decorators.

Both ConditionalMempoolFeeDecorator and ConditionalFeeDecorator short-circuit when the context flag IsFreeTx(ctx) is set, so free transactions are never charged a fee even if the user accidentally attaches one.

--gas auto (or --gas-adjustment 1.5) is still required because the SDK simulator must produce a gas estimate; if the estimate exceeds the meter cap (free or paid) the tx is rejected with out of gas. Free does not mean infinite.


Free Structs gameplay messages

Anything in KnownStructsMessages (defined in app/ante/maps.go) qualifies for the free-gas path, except MsgUpdateParams (governance). The list covers, as of v0.16.0:

Excluded from the free path:

If you want to see the canonical, complete list, read KnownStructsMessages in .references/structsd/app/ante/maps.go.


Free staking messages

The chain treats staking as a first-class gameplay action because reactor staking is what creates and powers a player. To remove that economic friction the following six messages are free, against a separate 40 M meter:

Constraints:

Use this for routine MsgDelegate / MsgUndelegate activity. If you need to send several staking ops in one block, batch them into a single tx (as long as it stays purely staking) – the throttle is on free txs, not on the messages inside the tx.


Anything not classified as free runs through the standard fee path:

These pay fees in ualpha like any other Cosmos SDK chain. Set --fees or --gas-prices accordingly.


Other ante checks that still apply

Even when a transaction is free, the rest of the ante chain still runs:

The DynamicPermissionMessages set (e.g. all UGC messages, address/permission management, guild membership voting flows) skips the ante-level permission check and lets the handler enforce the right permission, since the bits depend on runtime fields. This has nothing to do with fees – those messages are still free as long as the tx stays purely Structs.


Practical guidance


See Also