title_body: How to access the current slot in a Plutus validator script? At the time the Plutus validator script runs, the transaction is not yet part of the blockchain. But the targeted slot of a transaction is known when a node processes the script. Is it possible to access the target slot inside the validator script?
  
  The context of a validator script Plutus.V1.Ledger.Contexts.ScriptContext gives access to the transaction where txInfoValidRange may provide upper/lower bounds of the slot. This, however, requires that a Ledger.Constraints.mustValidateIn constraint has been specified when the transaction was submitted (as done in this example).
  
  I understand that it is considered to be bad practice for a Plutus validator script to depend on the state of the whole blockchain or unpredictable input such as the target slot because it limits verification/testing possibilities.
  
  
  Nevertheless, there might be plenty of good use cases for using the current slot; for example, an oracle might check if its data is expired and does not want to enforce its users to provide an upper limit in the mustValidateIn constraint.
upvoted_answer: Accessing any runtime information (including current slot) should not be possible in the validator by design. The reason is that transaction validity needs to be deterministic on construction. The only reason a transaction cannot be executed afterwards would be, if a UTXO was already consumed or the slot is outside of txInfoValidRange (as explained in this Youtube video).
  There might be other use cases, but making sure expired oracle data isn't consumed anymore could also be achieved by deactivating an oracle (which would require the oracle contract to support it). And also it is in the best interest of the party creating a transaction to make sure only trustworthy oracle data is consumed.