plutus time / slots
Why do we need this?
- Transaction timeouts
- Auction start date-time
Contradiction and clarification
How do we deal with time in validation scripts?
Validation takes place in wallet (i.e. locally). If validation scripts are time sensitive, surely there is time lapse between validation within the wallet and the transaction arriving at the node for validation.
So how can we guarantee determinism, where whatever works on the wallet also works in the node?
We add a slot range field to a transaction:
txInfoValidRange. This asserts that a transaction is valid within some timeframe.
Can’t guarantee same behaviour, but it will prevent us from running validation script in node, because we run pre-checks (which include timeframe check).
So validation script has exact same behaviour, since slot range is external to it.
Note: At this point the consensus protocol (Ouroboros) uses slots instead of POSIX time. 1 slot hardcoded to be 1 second, in the future hard fork may be needed to switch this.