ante

package
v7.0.3-mocha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSigVerificationGasConsumer = ante.DefaultSigVerificationGasConsumer

Functions

func FormatTx

func FormatTx(tx sdk.Tx) string

func NewAnteHandler

func NewAnteHandler(
	accountKeeper ante.AccountKeeper,
	bankKeeper authtypes.BankKeeper,
	blobKeeper blob.Keeper,
	feegrantKeeper ante.FeegrantKeeper,
	signModeHandler *txsigning.HandlerMap,
	sigGasConsumer ante.SignatureVerificationGasConsumer,
	channelKeeper *ibckeeper.Keeper,
	minfeeKeeper *minfeekeeper.Keeper,
	circuitkeeper *circuitkeeper.Keeper,
	paramFilters map[string]ParamFilter,
) sdk.AnteHandler

func ValidateTxFee

func ValidateTxFee(ctx sdk.Context, tx sdk.Tx, minfeeKeeper *minfeekeeper.Keeper) (sdk.Coins, int64, error)

ValidateTxFee implements default fee validation logic for transactions. It ensures that the provided transaction fee meets a minimum threshold for the node as well as a network minimum threshold and computes the tx priority based on the gas price.

func ValidateTxFeeWrapper

func ValidateTxFeeWrapper(minfeeKeeper *minfeekeeper.Keeper) ante.TxFeeChecker

ValidateTxFeeWrapper enables the passing of an additional minfeeKeeper parameter in ante.NewDeductFeeDecorator whilst still satisfying the ante.TxFeeChecker type.

Types

type ConsumeTxSizeGasDecorator

type ConsumeTxSizeGasDecorator struct {
	// contains filtered or unexported fields
}

ConsumeTxSizeGasDecorator will take in parameters and consume gas proportional to the size of tx before calling next AnteHandler. Note, the gas costs will be slightly overestimated due to the fact that any given signing account may need to be retrieved from state.

CONTRACT: If simulate=true, then signatures must either be completely filled in or empty. CONTRACT: To use this decorator, signatures of transaction must be represented as legacytx.StdSignature otherwise simulate mode will incorrectly estimate gas cost.

The code was copied from celestia's fork of the cosmos-sdk: https://github.com/celestiaorg/cosmos-sdk/blob/release/v0.46.x-celestia/x/auth/ante/basic.go In app versions v2 and below, the txSizeCostPerByte used for gas cost estimation is taken from the auth module. In app v3 and above, the versioned constant appconsts.TxSizeCostPerByte is used. In app v4 getting the account has been removed, which is in line with the cosmos-sdk v0.50.x.

func NewConsumeGasForTxSizeDecorator

func NewConsumeGasForTxSizeDecorator(ak ante.AccountKeeper) ConsumeTxSizeGasDecorator

func (ConsumeTxSizeGasDecorator) AnteHandle

func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type HandlePanicDecorator

type HandlePanicDecorator struct{}

HandlePanicDecorator that catches panics and wraps them in the transaction that caused the panic

func NewHandlePanicDecorator

func NewHandlePanicDecorator() HandlePanicDecorator

func (HandlePanicDecorator) AnteHandle

func (d HandlePanicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type MsgExecDecorator

type MsgExecDecorator struct{}

MsgExecDecorator ensures that the tx does not contain a MsgExec with a nested MsgExec or MsgPayForBlobs.

func NewMsgExecDecorator

func NewMsgExecDecorator() *MsgExecDecorator

func (MsgExecDecorator) AnteHandle

func (mgk MsgExecDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type ParamFilter

type ParamFilter func(sdk.Msg) error

ParamFilter is a type alias for a filtering function which accepts an sdk.Msg and returns an error.

type ParamFilterDecorator

type ParamFilterDecorator struct {
	// contains filtered or unexported fields
}

ParamFilterDecorator checks tx msgs for gov.MsgSubmitProposal and authz.MsgExec and ensures that param updates within these conform to the rules defined in paramFilters. ParamFilters are keyed by MsgTypeURL. NOTE: This replaces the param filter governance proposal handler from v3 and earlier.

func NewParamFilterDecorator

func NewParamFilterDecorator(paramFilters map[string]ParamFilter) ParamFilterDecorator

NewParamFilterDecorator creates and returns a new ParamFilterDecorator to be used in the ante handler chain.

func (ParamFilterDecorator) AnteHandle

func (d ParamFilterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

AnteHandle implements the AnteHandler interface. It ensures that MsgSubmitProposal has at least one message. It ensures params are filtered within messages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL