docs: clarification on timeout timestamp (#23322)

Co-authored-by: Alex | Interchain Labs <alex@skip.money>
This commit is contained in:
Julien Robert 2025-01-13 09:58:14 +01:00 committed by GitHub
parent 1b5b338eeb
commit 7da5372dd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -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`:

View File

@ -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.

View File

@ -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 {