From b336749d15497f065b465dae3c51e46a60104d37 Mon Sep 17 00:00:00 2001 From: Derek Leung Date: Wed, 20 Nov 2019 12:28:32 -0500 Subject: [PATCH] Deprecate FirstValidTime txn field inside TEAL programs. --- dev/TEAL.md | 6 +++--- dev/TEAL_opcodes.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/TEAL.md b/dev/TEAL.md index 3fa3fcf..e5f8664 100644 --- a/dev/TEAL.md +++ b/dev/TEAL.md @@ -141,7 +141,7 @@ Some of these have immediate data in the byte or bytes after the opcode. | 0 | Sender | []byte | 32 byte address | | 1 | Fee | uint64 | micro-Algos | | 2 | FirstValid | uint64 | round number | -| 3 | FirstValidTime | uint64 | Seconds since 1970-01-01 00:00:00 UTC of block at FirstValid-1 | +| 3 | FirstValidTime | uint64 | Causes program to fail; reserved for future use. | | 4 | LastValid | uint64 | round number | | 5 | Note | []byte | | | 6 | Lease | []byte | | @@ -249,6 +249,6 @@ Current design and implementation limitations to be aware of. * TEAL cannot lookup balances of Algos or other assets. (Standard transaction accounting will apply after TEAL has run and authorized a transaction. A TEAL-approved transaction could still be invalid by other accounting rules just as a standard signed transaction could be invalid. e.g. I can't give away money I don't have.) * TEAL cannot access information in previous blocks. TEAL cannot access most information in other transactions in the current block. (TEAL can access fields of the transaction it is attached to and the transactions in an atomic transaction group.) * TEAL cannot know exactly what round the current transaction will commit in (but it is somewhere in FirstValid through LastValid). -* TEAL cannot know exactly what time its transaction is committed. (`txn FirstValidTime` should be approximately the 'unix time' seconds since 1970-01-01 00:00:00 UTC of the block *before* FirstValid, but there are conditions in which this time may drift and slowly re-align to close to accurate time.) +* TEAL cannot know exactly what time its transaction is committed. * TEAL cannot loop. Its branch instruction `bnz` "branch if not zero" can only branch forward so as to skip some code. -* TEAL cannot recurse. There is no subroutine jump operation. \ No newline at end of file +* TEAL cannot recurse. There is no subroutine jump operation. diff --git a/dev/TEAL_opcodes.md b/dev/TEAL_opcodes.md index 43971a5..235acb6 100644 --- a/dev/TEAL_opcodes.md +++ b/dev/TEAL_opcodes.md @@ -347,7 +347,7 @@ Overflow is an error condition which halts execution and fails the transaction. | 0 | Sender | []byte | 32 byte address | | 1 | Fee | uint64 | micro-Algos | | 2 | FirstValid | uint64 | round number | -| 3 | FirstValidTime | uint64 | Seconds since 1970-01-01 00:00:00 UTC of block at FirstValid-1 | +| 3 | FirstValidTime | uint64 | Causes program to fail; reserved for future use. | | 4 | LastValid | uint64 | round number | | 5 | Note | []byte | | | 6 | Lease | []byte | | @@ -382,7 +382,7 @@ TypeEnum mapping: | 5 | afrz | AssetFreeze | -FirstValidTime is actually the time of the round at FirstValid-1. Subtle implementation details make it much faster to serve details of an already completed round. `int` accepts the user friendly names for comparison to `txn TypeEnum` +FirstValidTime causes the program to fail. The field is reserved for future use. ## global