Skip to content

Commit

Permalink
refactor: naming and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabarbakadze committed Oct 4, 2024
1 parent a31c0b8 commit d906239
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/ante/max_tx_size.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/appconsts/v3/app_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion pkg/appconsts/versioned_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func GasPerBlobByte(_ uint64) uint32 {
return v3.GasPerBlobByte
}

func TxMaxBytes(_ uint64) int {
func MaxTxBytes(_ uint64) int {
return v3.MaxTxBytes
}

Expand Down
2 changes: 1 addition & 1 deletion specs/src/ante_handler_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d906239

Please sign in to comment.