Repository navigation
Releases: onflow/cadence
Release list
v0.24 (Secure Cadence)
What's Changed
The Secure Cadence milestone is focused on code-hardening and will enable the permissionless deployment of smart contracts on Mainnet. It is an important step in our path to Stable Cadence.
This required some breaking changes. You can read all about these changes and how to update your contracts in this forum post:
Breaking changes coming with Secure Cadence release
While the focus was on securing Cadence, this release is also packed with many new features and improvements!
💥 Breaking Changes
- Zero-pad string representation of addresses by @turbolent in #1214
- Allow importing type and capability values by @dsainati1 in #1202
- Report an error when the parameter list is missing commas by @turbolent in #1073
- Use common super-type for expression type inferring by @SupunS in #1027
load,copyandborrowcause a force cast by @dsainati1 in #1286- Taking a reference to an optional value now produces an optionally-typed reference by @dsainati1 in #1303
- Disallow arithmetic, comparison and bitwise operations on number supertypes by @SupunS in #1360
- Add CharacterValue type by @dsainati1 in #1392
- Limit mutation of container-typed fields to the scope of the composite by @dsainati1 in #1267
⭐ Features
- Allow runtime types to be used as a dictionary key by @dsainati1 in #1186
- Add constructor functions for run-time types by @dsainati1 in #1195
- Add new syntax to bind for-in loop indices by @dsainati1 in #1216
- Find least common super-type by @SupunS in #1025
- Infer static type from the value itself for imported arrays/dictionaries by @SupunS in #1049
- Add a clone function to all values by @turbolent in #1229
- Allow scripts to access authorized accounts by @dsainati1 in #1240
- add
type(at: Path)function for inspecting the type of objects in storage by @dsainati1 in #1254 - Report a hint for casting an expression of type
Tto same typeTby @SupunS in #1072 - Add an interactive debugger to the command-line runner by @turbolent in #940
- Start development of a new pretty printer for Cadence programs by @turbolent in #1024
- Pretty print statements by @turbolent in #1280
- Pretty print types by @turbolent in #1281
- Add optional resource owner change tracking callback by @turbolent in #1289
- Add array slice function by @turbolent in #1315
- Add indexOf to array by @bjartek in #1352
- Check transfer and use of transferred or destroyed resources at runtime by @turbolent in #1461
- Add a package to run a script against all accounts by @turbolent in #1434
- Memory metering by @turbolent in #1653
- Add a checker option to short-circuit error reporting by @turbolent in #1562
🛠 Improvements
- Add smoke tests cadence values / storage operations by @SupunS in #1185
- Clean up types in
cadencepackage by @turbolent in #1204 - add missing types and conversion functions to cadence package by @dsainati1 in #1224
- Improve container mutation error message by @SupunS in #1228
- Updates Fungible Token tutorial to use a different structure and explanations by @joshuahannan in #1238
- Re-apply "Remove receiver type from function type" by @turbolent in #1272
- Disable existing hints if linting is disabled by @turbolent in #1275
- Remove redundant subtyping check by @dsainati1 in #1285
- Tweak Cadence bench to be more stable by @janezpodhostnik in #1290
- Improve state decoding tool by @turbolent in #1232
- Language Server updates by @MaxStalker in #1295
- Support recursive supertype inferring for containers by @SupunS in #1319
- Add safety checks for go casts in the interpreter by @dsainati1 in #1331
- Ignore dead code by @turbolent in #1345
- Add safety checks for go casts in the parser by @dsainati1 in #1343
- Allows adding new interface conformances during a contract update by @SupunS in #1395
- Refactor type assertions of host function arguments by @turbolent in #1422
- Check use of invalidated resources at runtime by @SupunS in #1464
- Expand interpreter tracing for composite, array and dictionary types by @ramtinms in #1450
- Extend subtyping rule for restricted type by @turbolent in #1486
- Check address length before decoding by @SupunS in #1522
- Add runtime subtype check using static types by @SupunS in #1487
- Improve new static type-based dynamic type checking by @turbolent in #1576
- Remove dynamic types by @turbolent in #1577
- Flowkit version update by @sideninja in #1534
- Adjust formulas for calculating memory usage of arithmetic operations on big integers by @turbolent in #1590
- Don't report errors for invalid types by @turbolent in #1597
- [LS] Crash reporting by @sideninja in #1600
- cadence.Value.Type method back to original param list by @robert-e-davidson3 in #1633
- [LS] Debugging documentation and utility functions by @sideninja in #1601
- Language reference docs improvement by @alilloig in #1627
- Limit number of tokens which can be replayed (reparsed) by @turbolent in #1620
- Improve constant-sized type parsing by @turbolent in #1613
- [LS] NPM release v0.24.0 crash reporting by @sideninja in #1641
- Refactor memory kinds and memory usages by @SupunS in #1667
- Improve error message for invalid public key by @SaveTheRbtz in #1665
- Limit depth of expressions and types by @turbolent in #1664
- Add token limit by @turbolent in #1668
- Fix local token replay limit, add global replay limit by @turbolent in #1663
- Handle and wrap non-error type panics in interpreterRuntime by @SupunS in #1678
- Update fxamacker/cbor and atree to latest versions by @fxamacker in #1682
- Differentiate invalidated resource use errors by @turbolent in #1706
- Optimize ByteSize functions for 7 Value types by @fxamacker in #1299
- Pool lexers to reduce allocations and improve performance by @turbolent in #1610
- Optimize HashInput functions to use scratch buffer provided by onflow/atree by @fxamacker in #1296
- Add more graceful handling for go type assertions in
runtime/semaby @dsainati1 in #1318 - Gracefully handle casts during comparison operators by @SupunS in #1330
🐞 Bug Fixes
- Fix smoke tests by @turbolent in #1198
- Fix composite-typed argument passing by @SupunS in #1235
- Gracefully handle invalid restrictions by @turbolent in #1249
- Replace
IsSubTypecheck withIsSameTypeKindcheck where necessary by @SupunS in #1032 - Gracefully handle casts during arithmetic operations by @SupunS in #1306
- Fix resource loss analysis and definite initialization analysis by @turbolent in #1332
- Fix and simplify parser buffering by @SupunS in #1333
- Fix type requirement checking by @SupunS in https://github.com/onflo...
Language Server v0.23.4
🛠 Improvements
- Add the Sentry crash reporting option if enabled by the client #1600 @sideninja
Language Server v0.23.0
🐞 Bug Fixes
Diagnostics not working on imported programs changes
When importing a program was changed it didn't re-check it leading to outdated diagnostics provided to the client. This was fixed by always re-checking imported programs. #1572 @sideninja
v0.23.4
v0.23.3
🐞 Bug Fixes
- Fix overflow error in Cadence
UIntto Gointconversion by @turbolent in #1550
Full Changelog: v0.23.2...v0.23.3
v0.23.2
🛠 Improvements
- Move computation metering and limit enforcement responsibility to the environment by @ramtinms, @janezpodhostnik in #1469, #1496
Full Changelog: v0.23.1...v0.23.2
v0.23.1
🛠 Improvements
- Extend subtyping rule for restricted type by @turbolent in #1480
Full Changelog: v0.23.0...v0.23.1
v0.23.0
💥 Breaking Changes
-
Remove
PublicKey.isValidby @robert-e-davidson3 in #1273, #1454The
PublicKeyconstructor now validates the public key data and aborts the program if it is invalid.
TheisValidfield was removed.
⭐ Features
-
Add converter functions to produce path values from strings by @dsainati1 in #1437, #1211
Paths can now be constructed at run-time. The following path constructors were added:
fun PublicPath(identifier: string): PublicPath? fun PrivatePath(identifier: string): PrivatePath? fun StoragePath(identifier: string): StoragePath?
Each of these functions take an identifier and produce a path of the appropriate domain.
For example, to construct a public path from a string:let pathID = "foo" let path = PublicPath(identifier: pathID) // is /public/foo
For more information, see https://docs.onflow.org/cadence/language/accounts/#path-functions
-
Add RLP decoding utility methods by @ramtinms in #1397, #1456
Cadence now provides RLP decoding functions through the built-in contract
RLP.
It provides the following functions for decoding strings and lists:fun decodeString(_ input: [UInt8]): [UInt8] fun decodeList(_ input: [UInt8]): [[UInt8]]
For more information, see https://docs.onflow.org/cadence/language/built-in-functions/#rlp
-
Add index to for loop by @dsainati1 in #1216, #1452
For-loops may now declare an indexing variable:
for index, element in array { // ... }
-
Add BLS-specific crypto functions by @dsainati1 in #1236, #1250, #1430
PublicKeygained a new function to verify a proof-of-possession:fun verifyPoP(_ proof: [UInt8]): Bool
Cadence now provides BLS-specific functions through the built-in contract
BLS.
It provides the following functions:fun aggregateSignatures(_ signatures: [[UInt8]]): [UInt8]? fun aggregatePublicKeys(_ publicKeys: [PublicKey]): PublicKey?
For more information, see https://docs.onflow.org/cadence/language/crypto/#bls
🛠 Improvements
-
Refactor account storage to use atree ordered maps by @turbolent in #1248, #1404 #1391
This storage format change will allow adding a storage querying API in the future.
-
Expand interpreter tracing for composite, array and dictionary types by @ramtinms in #1450, #1468
-
Bump onflow/atree to v0.2.0 by @fxamacker in #1470
This updates Cadence to the latest version of atree.
-
Improve BLS API by @turbolent in #1417
-
Improve RLP API by @turbolent in #1423
🐞 Bug Fixes
- Make error reporting in contract update validation deterministic by @turbolent in #1420, #1428
🙌 New Contributors
Thank you to our new contributor, @robert-e-davidson3!
Full Changelog: v0.21.3...v0.23.0
v0.21.3
🐞 Bug Fixes
- Fix resource field nesting check for enum raw value field by @turbolent in #1462
- Fix resource checking by @turbolent in #1463
Full Changelog: v0.21.2...v0.21.3
v0.21.2
🐞 Bug Fixes
- Require static types for all host function values by @turbolent in #1407
- Fix boxing in casts by @turbolent in #1408
- Fix EOF emission in lexer by @turbolent in #1409
- Consider halting when determining definite invalidation by @turbolent in #1411
- Fix acceptance of buffered errors by @turbolent in #1410
- Make error reporting in contract update validation deterministic by @turbolent in #1427
Full Changelog: v0.21.1...v0.21.2