diff --git a/docs/learn/advanced/01-transactions.md b/docs/learn/advanced/01-transactions.md index 35d319f19b0..f24aa571538 100644 --- a/docs/learn/advanced/01-transactions.md +++ b/docs/learn/advanced/01-transactions.md @@ -149,6 +149,8 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.2/client/tx_config.go#L39 * `Memo`, a note or comment to send with the transaction. * `FeeAmount`, the maximum amount the user is willing to pay in fees. * `TimeoutHeight`, block height until which the transaction is valid. +* `TimeoutTimestamp`, timestamp until which the transaction is valid. +* `Unordered`, whether transactions can be executed in any order. Nonce is then unevaluated (NOTE: A timeout timestamp must be set if `Unordered` is true). * `Signatures`, the array of signatures from all signers of the transaction. As there are currently two sign modes for signing transactions, there are also two implementations of `TxBuilder`: diff --git a/x/auth/README.md b/x/auth/README.md index 4adf48bdb20..dce25b4e10f 100644 --- a/x/auth/README.md +++ b/x/auth/README.md @@ -165,7 +165,7 @@ The auth module provides `AnteDecorator`s that are recursively chained together * `ValidateBasicDecorator`: Calls `tx.ValidateBasic` and returns any non-nil error. -* `TxTimeoutHeightDecorator`: Check for a `tx` height timeout. +* `TxTimeoutHeightDecorator`: Check for a `tx` height or time-based timeout. * `ValidateMemoDecorator`: Validates `tx` memo with application parameters and returns any non-nil error. diff --git a/x/auth/ante/basic.go b/x/auth/ante/basic.go index 3f288460e8f..9b0b15469e5 100644 --- a/x/auth/ante/basic.go +++ b/x/auth/ante/basic.go @@ -217,7 +217,7 @@ func isIncompleteSignature(data signing.SignatureData) bool { type ( // TxTimeoutHeightDecorator defines an AnteHandler decorator that checks for a - // tx height timeout. + // tx height and timestamp timeout. TxTimeoutHeightDecorator struct { env appmodulev2.Environment } @@ -253,6 +253,8 @@ func (txh TxTimeoutHeightDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ boo // type where the current block height is checked against the tx's height timeout. // If a height timeout is provided (non-zero) and is less than the current block // height, then an error is returned. +// Additionally, if a timestamp timeout is provided and is less than the current +// block time, then an error is returned. func (txh TxTimeoutHeightDecorator) ValidateTx(ctx context.Context, tx sdk.Tx) error { timeoutTx, ok := tx.(TxWithTimeoutHeight) if !ok {