diff --git a/app/ante/max_tx_size.go b/app/ante/max_tx_size.go index f4e560a2cb..dd1da920f6 100644 --- a/app/ante/max_tx_size.go +++ b/app/ante/max_tx_size.go @@ -19,7 +19,7 @@ func NewMaxTxSizeDecorator() MaxTxSizeDecorator { func (d MaxTxSizeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { // Tx size rule applies to app versions v3 and onwards. if ctx.BlockHeader().Version.App >= v3.Version { - if len(ctx.TxBytes()) >= appconsts.TxMaxBytes(ctx.BlockHeader().Version.App) { + if len(ctx.TxBytes()) >= appconsts.MaxTxBytes(ctx.BlockHeader().Version.App) { return ctx, sdkerrors.ErrTxTooLarge } } diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index 95c2139471..2d16d59993 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -6,5 +6,5 @@ const ( SubtreeRootThreshold int = 64 TxSizeCostPerByte uint64 = 10 GasPerBlobByte uint32 = 8 - MaxTxBytes int = 2097152 // 2MG (2 * 1024 * 1024) + MaxTxBytes int = 2097152 // 2 MiB in bytes ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 38af704745..6a186afe71 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -42,7 +42,7 @@ func GasPerBlobByte(_ uint64) uint32 { return v3.GasPerBlobByte } -func TxMaxBytes(_ uint64) int { +func MaxTxBytes(_ uint64) int { return v3.MaxTxBytes } diff --git a/specs/src/ante_handler_v3.md b/specs/src/ante_handler_v3.md index f2f6087d71..f379ef2d00 100644 --- a/specs/src/ante_handler_v3.md +++ b/specs/src/ante_handler_v3.md @@ -3,7 +3,7 @@ The AnteHandler chains together several decorators to ensure the following criteria are met for app version 3: - The tx does not contain any messages that are unsupported by the current app version. See `MsgVersioningGateKeeper`. -- The tx size is not larger than the application's configured versioned constant MaxTxSize. +- The tx size is not larger than the application's configured versioned constant MaxTxBytes. - The tx does not contain any [extension options](https://github.com/cosmos/cosmos-sdk/blob/22c28366466e64ebf0df1ce5bec8b1130523552c/proto/cosmos/tx/v1beta1/tx.proto#L119-L122). - The tx passes `ValidateBasic()`. - The tx's [timeout_height](https://github.com/cosmos/cosmos-sdk/blob/22c28366466e64ebf0df1ce5bec8b1130523552c/proto/cosmos/tx/v1beta1/tx.proto#L115-L117) has not been reached if one is specified.