Skip to content

Commit

Permalink
docs: clarification on timeout timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Jan 10, 2025
1 parent a6b0924 commit fdbd1eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/learn/advanced/01-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
2 changes: 1 addition & 1 deletion x/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 timeout or time timeout.

* `ValidateMemoDecorator`: Validates `tx` memo with application parameters and returns any non-nil error.

Expand Down
4 changes: 3 additions & 1 deletion x/auth/ante/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit fdbd1eb

Please sign in to comment.