AnteHandler v12
The AnteHandler chains together several decorators to ensure the following criteria are met for app version 12:
- Panics are wrapped with the transaction string format for better error reporting.
- A gas meter is set up in the context before any gas consumption occurs.
- The tx does not contain any messages that are disabled by the circuit breaker (e.g.
MsgSoftwareUpgrade,MsgCancelUpgrade,MsgIBCSoftwareUpgrade). - The tx does not contain a Msg that can never succeed in app version 12 (see Types v12), also inside a
MsgExecorMsgSubmitProposal. - The tx does not contain any extension options.
- The tx passes
ValidateBasic(). - The tx's timeout_height has not been reached if one is specified.
- The tx's memo is <= the max memo characters where
MaxMemoCharacters = 256. - The tx's gas_limit is > the gas consumed based on the tx's size where
TxSizeCostPerByte = 10. - The tx's feepayer has enough funds to pay fees for the tx. The tx's feepayer is the feegranter (if specified) or the tx's first signer. Note the feegrant module is enabled.
- The tx's gas price is >= the network minimum gas price where
NetworkMinGasPrice = 0.000001utia. - Every signer public key has the length of its key type.
- Public keys are set in the context for the fee-payer and all signers.
- The tx's count of signatures <= the max number of signatures. The max number of signatures is
TxSigLimit = 7. - The tx's gas_limit is > the gas consumed based on the tx's signatures.
- The tx's signatures are valid. For each signature, ensure that the signature's sequence number (a.k.a nonce) matches the account sequence number of the signer.
- The tx does not contain a
MsgExecorMsgSubmitProposalthat wraps aMsgPayForBlobs,MsgPayForFibre,MsgPaymentPromiseTimeout,MsgDepositToEscrow,MsgRequestWithdrawal,MsgExecorMsgSubmitProposal. AMsgSubmitProposalalso cannot wrap a zkismMsgCreateInterchainSecurityModule,MsgUpdateInterchainSecurityModule,MsgSubmitMessagesorMsgUpdateVerifyingKeys, a HyperlaneMsgProcessMessage, or an IBCMsgRecvPacket. - The tx's gas meter is charged
GasPerAdditionalSDKMessage = 20,000for each message counted againstMaxSDKMessagesbeyond the first, including the messages aMsgExecor an ICA packet executes and each request of aMsgModuleQuerySafe. - The tx's gas meter is charged
GasPerISMSignature = 36,000for each signature a HyperlaneMsgProcessMessagecarries. - The tx does not create a Hyperlane multisig ISM (
MsgCreateMessageIdMultisigIsmorMsgCreateMerkleRootMultisigIsm) with more thanMaxMultisigISMValidators = 100validators. - The tx does not contain a
MsgModuleQuerySafewith more thanMaxModuleQuerySafeRequests = 1request. - The tx's gas meter is charged a fixed amount of gas per validator signature in a
MsgPayForFibre, before the signatures are checked. - The tx's gas_limit is > the gas consumed based on the blob size(s). Since blobs are charged based on the number of shares they occupy, the gas consumed is calculated as follows:
gasToConsume = sharesNeeded(blob) * bytesPerShare * gasPerBlobByte. WherebytesPerShareis a global constant (an alias forShareSize = 512) from the go-square package andgasPerBlobByteis a versioned constant that can be modified through hard forks (theGasPerBlobByte = 8). - The tx's total blob share count is <= the max blob share count. The max blob share count is derived from the maximum valid square size. The max valid square size is the minimum of:
GovMaxSquareSizeandSquareSizeUpperBound. - In
CheckTxand recheck only, theMsgPayForFibrepayment promise can still settle (for example, it has not already been settled). This keeps unsettleable promises out of the mempool;PrepareProposalremains the authoritative settlement check. - In every mode except
FinalizeBlock, recheck and simulation, theMsgPayForFibrevalidator signatures are valid. Signatures that already passed verification are cached and not re-verified. These modes skip this check, so a committed block's outcome never depends on the node-local cache. - The tx does not contain a message of type MsgSubmitProposal with zero proposal messages or with a proposal message that modifies a parameter that is not governance modifiable.
- The tx is not an IBC packet or update message that has already been processed.
In CheckTx, a tx is also rejected before the AnteHandler runs if it counts more than MaxSDKMessages = 300 messages, more than MaxZKProofMessages = 64 ZK proof-work messages or more than MaxISMSignatures = 2048 Hyperlane ISM signatures, each including the messages a MsgExec or an ICA packet executes, or if it is not a MsgPayForFibre tx and its gas limit exceeds MaxSDKGas = 100,000,000.
In addition to the above criteria, the AnteHandler also has a number of side-effects:
- Tx fees are deducted from the tx's feepayer and added to the fee collector module account.
- Tx priority is calculated based on the smallest denomination of gas price in the tx and set in context.
- The nonce of all tx signers is incremented by 1.