Releases: algorandfoundation/puya
v2.0.1
v2.0.1 (2024-05-21)
Fix
-
fix incorrectly mapped transaction arguments
global_num_uint
andlocal_num_uint
inalgopy.arc4.abi_call
#232 (0c35caa
) -
resolve issue when using native types with arguments and return values in abi_call (
38a199a
) -
correct default value for fee in abi_call (
ac46f49
) -
fix IR return types of
b+
andb*
ops (0de49c1
) -
correct return type of String.join expression (
873460d
) -
corrected itxn field type definitions for
VotePK
,SelectionPK
andFreezeAssetFrozen
(5f59f15
) -
correctly handle
BigUInt
in ARC4 methods (354a4a2
) -
handle resolve reinterpret cast at the IR level with a temporary assignment if required (#219) (
4b1bff3
) -
do not match
dup2
op when performing constant stack shuffling (815e253
) -
remove type bound on
TemplateVar
allowing it to be used with all types. (4226e0f
)
Documentation
v2.0.0
v2.0.0 (2024-04-26)
🚨 BREAKING CHANGES 🚨
Support inner transactions being assigned to unpacked tuples
Accessing an array field of an inner transaction result after it may no longer be available (i.e. after another inner transaction submission) is now a compile error, to resolve this move the array field access before the statement that causes this.
Commit: 0915c5c
Prevent usage of state proxies (GlobalState, LocalState) outside __init__
method
Using state proxies (GlobalState, LocalState) outside of an __init__
method may not give the behaviour expected, so prevent their usage in those scenarios.
Commit: d354d4e
Default transaction fees to 0
(#202)
The default fee for inner transactions is now 0 unless explicitly specified.
Commit: 519957f
Feature
- Allow wider range of algorand-python versions as long as no incompatible definitions are used. Instead of an error, a prominent warning is displayed if there is a potential mismatch. (
bf84501
) - Allow raw
select
op usage, since it's a very efficient way to do a ternary operator if greedy argument evaluation is acceptable (e91a157
) - Constant optimisation for
algopy.op.sqrt
andalgopy.op.bsqrt
(bb8f03b
) - Allow int literals with
algopy.op
functions that take aBigUInt
(currently justbsqrt
) (a8e14c3
) - Add missing constant folding optimization for b% (
9536d59
) - Add support for
bool
types in state proxies (e.g.GlobalState
) and remove generic type constraint. (c9a7224
) - Allow module constants to be used as
assert
statement messages (328ee55
)
Fix
- Add missing
asset_sender
field to inner transactions (fd6bba3
) - Treat unassigned & unsubmitted inner-transaction field-sets as a code error, not an internal error (
b86bfa6
) - Use return type of method signature as return type for an
abi_call
without an indexed type param (1318459
) - Fix issue #195 where certain state comparisons could fail to compile. (
b8efcc3
) - Add missing ARC4-copy-checks of
.get()
and.maybe()
methods in state proxies (49da224
) - Allow negative
arc4.Tuple
indexing (67ff876
) - Add missing stub indicators for unary
+
operator toBigUInt
andUInt64
(caa98dc
) - Improve error message with invalid
String()
comparisons (f340c86
) - Improve source location for
Asset(<int>)
(7c89ad7
) - Correct input value types for
algopy.op.setbit
(c8fda82
) - Handle
arc4.Address.native
(6dcb55d
) - References to unknown symbols are now correctly treated as code errors rather than fatal errors (
eb802d3
) - Fix unnecessary
.copy()
requirement when providing an ARC4 encoded initial value toGlobalState
(5a56041
) - Ensure ARC router generation works with minimal contracts that don't have any explicit abimethods (
936f378
) - Fix bug with failing to discard unassigned results from
algopy.op.*
functions (33d961a
) - Prevent multiline assert messages from breaking TEAL output (
4ea5ae6
) - Fix incorrect error message on unsupported class declaration (
8eb5a78
) - Add colorama as a dependency on Windows, this is required when using PowerShell (
0acb4b2
)
Documentation
- Add note about method behaviour for accounts which have not opted in (
12282b9
) - Use best practices in ARC-4 examples of dealing with native types and letting the router do encode/decode, which generally saves at least one op. (
7504ed5
) - Simplify "Quick start" steps (
01a9f95
) - Adding missing install step to install algorand-python (
c08f753
) - Corrections & improvements to
BigUInt
type docs (7e20261
)
v1.0.1
v1.0.0
v0.7.1
v0.7.0
v0.7.0 (2024-03-26)
Feature
-
Allow mutable tuple items to be updated (
8ea6ed5
) -
warn if a Contract class is implicitly abstract (
4d6317f
) -
compare
arc4.Address
againstAccount
(3888220
) -
empty constructor for arc4 numeric types, defaults to zero (
c514753
) -
allow bytes literal with
BytesBacked.from_bytes
(d47be8c
) -
empty constructor for BigUInt() defaults to zero (
c02079b
) -
empty constructor for UInt64() defaults to zero (
6f79b8a
) -
simplify more conditions when we're in a
select
context (7403e7b
) -
simplify more conditions when we're in a ConditionalBranch context (
80f0167
) -
simplify more conditions when we're in an assert context (
7f89b6c
) -
allow bytes optimizations to handle
addr
constants, and alsoglobal ZeroAddress
ops (a508274
) -
Allow empty constructors to default to "zero" values for Account, Asset, Application, and arc4.Address (
3ad9c18
) -
Add a validation step to confirm ops used in an app or lsig are available for those respecitve modes (
8600d4e
) -
add empty
arc4.Bool
constructor to mimicbool()
(6175b59
) -
remove
encode()
from ARC4 types, an ensure constructors take appropriate values. Ensure all ARC4 types havefrom_log
classmethod. Removedecode()
method and instead have anative
property that returns decoded values where appropriate (146748e
) -
Allow arc4 types to be used in native tuples in ABI methods (
0948d83
) -
add class options for declaring storage values used in ARC32 specifications (#123) (
5721f4a
) -
allow primitive String type to be used in arc4 methods (
23fa701
) -
add startswith, endswith, and join to String (
262c679
) -
add primitive UTF-8 String type (
14d35c6
) -
add support for emitting ARC-28 events (
aa4a651
) -
allow TEAL optimizer to handle dup/dupn ops when removing stack shuffling of constants, and collapse any repeated elements with a dup/dupn (
b48db43
) -
added
puyapy.arc4.call_abi
for typed contract to contract calls (#112) (3d42df3
) -
add optimization to propagate constants found in Phi nodes resolving to the same constant value (
1b2e504
) -
add asset and application reference types to op module (#124) (
47741ab
) -
Template variables (
9d93fee
) -
pop/popn collapse optimisation (
0b90505
) -
Allow slicing Bytes with UInt64. Code generation has also been improved for slicing, and a potential double-evaluation has been fixed. (
0f9dd79
) -
implement ordering comparisons for arc4.UIntN and arc4.BigUIntN types (
f83a397
) -
implement missing optimisations for self comparisons (
24ead20
) -
improved constant folding, particularly with ARC4 operations (
17216c4
) -
optimisation of extract_uint16/32/64 with constants (
bf00f0d
) -
allow optimisation to concat bytes with different encodings (
e3c6253
) -
allow itob of a constant to flow through further optimisations (
ea2ce28
) -
implement boolean evaluation of ARC4 types (
aaa32ad
) -
Local/GlobalState custom keys & descriptions (
e9d5084
) -
add version option to CLI (
44b5e7f
)
Fix
-
Improve coverage of arc4_copy validator (
b482ebe
) -
arc4.String() gets incorrectly inferred as native String wtype (
4b12156
) -
ensure all
index_multiple
methods have the same signature (0c93a47
) -
treat ARC4 Tuples with mutable elements as mutable overall (
7f7a4b6
) -
fix source location for function signatures (
14b9eb3
) -
use repr for literal validation errors (
2d0feee
) -
add some missing positional-only indicators to stubs, and relax typing.LiteralString to str, it's not really applicable for our use case (
f5031a5
) -
don't implicitly map [32]byte to Account in stubs (
668c2e0
) -
consistent usage of positional-only arguments in stubs (
547d62c
) -
produce error with incorrect arc4 numeric class usage based on bit-sizes (
4cb6bbc
) -
check for state exceeding known consensus parameters and warn (not an error in case the consensus parameters update before a new compiler release) (
d65b350
) -
allow references to module constants in StateTotals args (
550fbd3
) -
Fix optimizer bug where differing behaviour of extract with & without immediates when length is zero was not accounted for (
6a8db34
) -
handle tuple return types in method signatures (
6d31a69
) -
don't inline control ops of Switch or GotoNth nodes if it would result in additional copies in destructured SSA (#130) (
189847d
) -
check for errors between each stage of compiler pipeline (
b860e5a
) -
no longer eliminate expressions outside of dominators...
v0.6.0
v0.6.0 (2024-02-20)
Breaking Changes
-
many functions and classes under
puyapy
can now be found inpuyapy.op
. Values that are constant for a transaction in thepuyapy.op.Global
andpuyapy.op.Transaction
classes are now typed as final class vars instead of methods -
Classes related to group transactions are now under the
puyapy.gtxn
module -
The following op code classes were renamed:
Original name New name AppGlobals
AppGlobal
AppLocals
AppLocal
Transaction
Txn
TransactionGroup
GTxn
InnerTransaction
ITxn
InnerTransactionGroup
GITxn
CreateInnerTransaction
ITxnCreate
Ecdsa
ECDSA
Ec
EC
-
--output-cssa-ir
and--output-parallel-copies-ir
CLI options have been removed, and--output-final-ir
is now--output-destructured-ir
to better reflect its position in the compiler chain. -
The default debug level is now 1, and only one TEAL file will be emitted for each program. To get back the previous default behaviour of only outputting an unannotated teal file, pass
-g0
.
Feature
-
improve coalescing by performing before sequentialisation, thus reducing chances of interference (
a29fba9
) -
reduce number of iterations required by optimiser by enabling fixed point iteration within ControlOp simplifier optimisation step (
b7b27d3
) -
add simple pass to collapse constants repeated >= 2 times by using a dupn (
47d90d6
) -
add duplicate block elimination as a post-SSA optimisation, at -O2 or above since it can mess with debugging info quite a bit (
c13d8fe
) -
add API for creating and submitting inner transactions (#98) (
6b76183
) -
move ops into their own module (
7678a7e
)
Fix
v0.5.1
v0.5.0
v0.5.0 (2024-02-06)
Feature
-
Check min_avm_version of intrinsic ops against target avm version for compiler (
2b3dea0
) -
update langspec to v10 (
be62082
) -
Optimise constant mod expressions and pre-check for div 0 errors (
24c5020
)
Fix
-
Use
Bytes
as the return type where the langspec lists[32]byte
instead ofAccount
(41bead7
) -
improve error output when parsing fails (
c3d8f25
) -
Don't unnecessarilly pre-check uranges for forward iteration (
066088c
) -
Don't raise on div 0 in optimizer as the operation might be pre-checked for != 0 in previous operations (
6d549ed
)
v0.4.0
v0.4.0 (2024-01-31)
Feature
Fix
-
fix argument matching order for gtxn, gtxna, gtxnsa, gtxnas. (
6d10fef
) -
correct intrinsic mapping for
RenamedOpCode
types, so that the correct overload gets chosen. This is particularly important for extract, where a 0 immediate for length (along with an immediate for start) behaves very differently to the stack based variant. There is still potential for confusion if the start parameter is a literal vs a constant UInt64, but this at least fixes the inability to get the correct result with the right set of args. (7bf88e3
) -
fix potential bug when removing an empty entry block that had a goto which was not the next block (
11c6a3e
) -
Add slot range validation to range expressions which specify a step (
3ccd47f
)