x/auth module presently has no transaction handlers of its own, but does expose the special
AnteHandler, used for performing basic validity checks on a transaction, such that it could be thrown out of the mempool.
AnteHandler can be seen as a set of decorators that check transactions within the current context, per ADR 010 (opens new window).
Note that the
AnteHandler is called on both
DeliverTx, as Tendermint proposers presently have the ability to include in their proposed block transactions which fail
The auth module provides
AnteDecorators that are recursively chained together into a single
AnteHandler in the following order:
SetUpContextDecorator: Sets the
Contextand wraps the next
AnteHandlerwith a defer clause to recover from any downstream
OutOfGaspanics in the
AnteHandlerchain to return an error with information on gas provided and gas used.
RejectExtensionOptionsDecorator: Rejects all extension options which can optionally be included in protobuf transactions.
MempoolFeeDecorator: Checks if the
txfee is above local mempool
tx.ValidateBasicand returns any non-nil error.
TxTimeoutHeightDecorator: Check for a
txmemo with application parameters and returns any non-nil error.
ConsumeGasTxSizeDecorator: Consumes gas proportional to the
txsize based on application parameters.
DeductFeeDecorator: Deducts the
FeeAmountfrom first signer of the
tx. If the
x/feegrantmodule is enabled and a fee granter is set, it will deduct fees from the fee granter account.
SetPubKeyDecorator: Sets the pubkey from a
tx's signers that does not already have its corresponding pubkey saved in the state machine and in the current context.
ValidateSigCountDecorator: Validates the number of signatures in
txbased on app-parameters.
SigGasConsumeDecorator: Consumes parameter-defined amount of gas for each signature. This requires pubkeys to be set in context for all signers as part of
SigVerificationDecorator: Verifies all signatures are valid. This requires pubkeys to be set in context for all signers as part of
IncrementSequenceDecorator: Increments the account sequence for each signer to prevent replay attacks.