Releases: onflow/cadence
v0.17.0
β Features
- Add deferred decoding support for dictionary values (#925) @SupunS
- Track origin's occurrences (#907) @turbolent
- Declare more ranges (#882) @turbolent
- Language Server: Suggest completion items for declaration ranges (#881) @turbolent
- Provide code action to declare field and function (#961) @turbolent
- Provide code action to declare variable/constant (#946) @turbolent
- Add code action to implement missing members (#942) @turbolent
- Provide code actions / quick fixes (#941) @turbolent
- Provide documentation for range completion items (#923) @turbolent
- Record docstrings in variables (#922) @turbolent
- Add a
String.utf8
field (#954) @turbolent - Provide signature help (#911) @turbolent
- Add a String constructor function and a String.encodeHex function (#953) @turbolent
- Record position information for function invocations (#910) @turbolent
- Add function docs formatting support (#938) @SupunS
- Add Cadence documentation generator (#927) @SupunS
- Rename all occurrences of a symbol in the document (#909) @turbolent
- Enable DocumentSymbol capability for Outline (#662) @MaxStalker
- Add an AST walking function (#939) @turbolent
- Add HexToAddress utility function, add tests for address functions (#932) @turbolent
- Highlight all occurrences of a symbol in the document (#908) @turbolent
π Improvements
- Add deferred decoding support for dictionary values (#925) @SupunS
- Improve type inference for binary expressions (#957) @turbolent
- Update language server to Cadence v0.16.0 (#926) @turbolent
- [Doc-Gen Tool] Add documentation generation support for event declarations (#985) @SupunS
- [Doc-Gen Tool] Group declarations based on their kind (#984) @SupunS
- Check 'importability' instead of 'storability' for transaction arguments (#983) @SupunS
- Allow native composite types to be passed as script arguments (#973) @SupunS
- Validate UTF-8 compatibility in string value constructor (#972) @SupunS
- Cache type ID for composite types (#950) @SupunS
- [Optimization] Make dynamic types singleton for simple types (#963) @SupunS
- Include docstrings in value and type variables, improve hover markup (#945) @turbolent
- Always check arguments and record the argument types in the elaboration (#951) @turbolent
- Optimize qualified identifier creation (#948) @SupunS
- Optimize
Type
function declaration (#949) @turbolent - [Optimization] Re-use converter functions across interpreters (#947) @SupunS
- Update and extend the source compatibility suite (#977) @turbolent
- Update to Go 1.16.3's libexec/misc/wasm/wasm_exec.js (#929) @turbolent
π Bug Fixes
- Track origin's occurrences (#907) @turbolent
- Bring back fmt.Stringer implementation for interpreter.Value (#969) @turbolent
- Fix the initialization order in the interpreter (#958) @turbolent
- Fix parsing of negative fractional fixed-point strings (#935) @mikeylemmon
- capture computation used for all transactions (#895) @ramtinms
- Only wrap a type in an optional if it is not nil (#937) @turbolent
π§ͺ Tests
- Add test case for invalid utf8 string import (#968) @SupunS
- Test contract member initialization (#931) @turbolent
π Documentation
- Update account docs to not to pass PublicKey as an argument (#967) @SupunS
- Improve the crypto doc (#960) @tarakby
π Chore
- Use actions/setup-go@v2 to speed up CI by ~10 secs and specify Go 1.15.x (#971) @fxamacker
- Remove italics from auto flow-go PR (#988) @janezpodhostnik
- Improve sync flow_go action (#987) @janezpodhostnik
- Fix for auto-update flow-go: no fail on tidy (#986) @janezpodhostnik
- Auto update flow-go github action (#981) @janezpodhostnik
- Remove coverage of empty functions from report (#944) @turbolent
- Improve coverage calculation (#933) @turbolent
v0.16.1
v0.16.0
π₯ Breaking Changes
-
Add new crypto features (#852) @SupunS
Renamed the
ECDSA_Secp256k1
signature algorithm toECDSA_secp256k1
.Please update existing contracts, transactions, and scripts to use the new name.
-
Remove the high-level storage API (#877) @turbolent
The internal interface's
SetCadenceValue
function was removed.This change does not affect Cadence programs (contracts, transactions, scripts).
β Features
-
Add non-local type inference for expressions (#875) @SupunS
The type of most declarations and expressions is now inferred in a uni-directional way, instead of only locally.
For example, this allows the following declarations to type-check without having to add static casts:
let numbers: [Int8] = [1, 2, 3] let nestedNumbers: [[Int8]] = [[1, 2], [3, 4]] let numberNames: {Int64: String} = {0: "zero", 1: "one"} let sum: Int8 = 1 + 2
-
Add new crypto features (#852) @SupunS
Hash Algorithms
- Added KMAC128_BLS_BLS12_381 hashing algorithm):
HashAlgorithm.KMAC128_BLS_BLS12_381
Signature Algorithms
- Added BLS_BLS12_381 signature algorithm:
SignatureAlgorithm.BLS_BLS12_381
PublicKey
Type-
Added the field
let isValid: Bool
. For example:let publicKey = PublicKey(publicKey: [], signatureAlgorithm: SignatureAlgorithm.ECDSA_P256) let valid = publicKey.isValid
-
Added the function
verify
, which allows validating signatures:pub fun verify( signature: [UInt8], signedData: [UInt8], domainSeparationTag: String, hashAlgorithm: HashAlgorithm ): Bool
For example:
let valid = publicKey.verify( signature: [], signedData: [], domainSeparationTag: "something", hashAlgorithm: HashAlgorithm.SHA2_256 )
-
Added the function
hashWithTag
, which allows hashing with a tag:pub fun hashWithTag( _ data: [UInt8], tag: string, algorithm: HashAlgorithm ): [UInt8]
- Added KMAC128_BLS_BLS12_381 hashing algorithm):
-
Direct contract function invoke (#878) @janezpodhostnik
Cadence now supports an additional function to allow the host environment to call contract functions directly.
-
Language Server: Add support for access check mode (#868) @turbolent
-
Record variable declaration ranges (#880) @turbolent
β‘οΈ Performance
The performance of decoding and encoding values was significantly improved by @fxamacker and @SupunS:
- Optimize encoding by using CBOR lib's StreamEncoder (#830) @fxamacker
- Optimize decoding by using CBOR StreamDecoder (#885) @fxamacker
- Add deferred decoding for array values (#871) @SupunS
- Add deferred decoding support for composite values (#896) @SupunS
- Pre-allocate and reuse value-path for encoding (#858) @fxamacker
- Pre-allocate and reuse value-path for decoding (#869) @turbolent
- Optimize Address.Bytes() to inline fast path (#848) @fxamacker
- Remove call to Valid() during encoding to boost speed by about 13-18% (#857) @fxamacker
- Directly create int subtype value at interpreter (#913) @SupunS
π Improvements
- Refactor Language Server to use CLI shared library (#751) @MaxStalker
- Make PublicKey value immutable (#879) @SupunS
- Language Server: update flow-cli (#894) @psiemens
- Update language server to latest Cadence and Go SDK (#874) @psiemens
- Make the interpreter location optional (#918) @turbolent
π Security
This release contains major security fixes:
-
Declare post-condition result variable as reference if return type is a resource (#905) @turbolent
We would like to thank Deniz Mert Edincik for finding and reporting this critical issue responsibly through our Responsible Disclosure Policy.
See https://forum.onflow.org/t/fixed-cadence-vulnerability-2021-04-13
-
Fix dynamic subtype test for reference values (#914) @turbolent
We would like to thank Deniz Mert Edincik for finding and reporting this critical issue responsibly through our Responsible Disclosure Policy.
We would also like to thank Mikey Lemmon for finding this issue independently and reporting it responsibly, too.
See https://forum.onflow.org/t/fixed-cadence-vulnerability-2021-04-20
-
Check storability when value is written (before it is encoded) (#915) @turbolent
We would like to thank Deniz Mert Edincik for finding and reporting this medium issue responsibly through our Responsible Disclosure Policy.
See https://forum.onflow.org/t/fixed-cadence-vulnerability-2021-04-20
-
Check the index bounds for arrays (#917) @turbolent
We would like to thank MΓ‘rio Silva for finding and reporting this medium issue responsibly through our Responsible Disclosure Policy.
π Bug Fixes
- Improve reference values' dynamic type, static type, copy, equal, and conformance functions (#921) @turbolent
- Implement
StaticType
forStorageReferenceValue
andEphemeralReferenceValue
(#920) @turbolent - Fix strings (#919) @turbolent
- PublicKeyValue stringer fix (#903) @janezpodhostnik
- Handle recursive values (due to references) in string function (#906) @turbolent
- Handle case with no arguments (#886) @MaxStalker
- Fix link function return value (#865) @turbolent
- Fix optional type ID, add tests (#864) @turbolent
- Fix function type members (#867) @turbolent
- Language Server: Reuse existing checkers instead of re-parsing and re-checking imports (#855) @turbolent
- Only consider the program invalid if there are error diagnostics (#854) @turbolent
π§ͺ Tests
- Add test for TopShot moment batch transfer (#826) @turbolent
- Test equal for nil value, in comparison and switch (#866) @turbolent
- Test storing capabilities (#856) @turbolent
- Test getCapability after unlink (#849) @turbolent
- Add interpreter tests for common resource reference usages (#916) @turbolent
- Add extra test for deterministic JSON export (#893) @m4ksio
π Documentation
- Add a reference to PublicKey in the crypto docs (#912) @SupunS
- Tutorial typo fixes (#825) @joshuahannan
- Update values-and-types.mdx (#827) @FeiyangTan
π Chores
- Enable more linters and lint (#902) @turbolent
- Measure and report code coverage (#899) @turbolent
- Fix CI linter failure (#904) @SupunS
- Fix Codecov "file not found at ./coverage.txt" (#901) @fxamacker
v0.15.1
π Improvements
- Include wrapped error in InvalidEntryPointArgumentError message (#823) @mikeylemmon
- Remove encoding and decoding support for storage references (#819) @turbolent
π Documentation
- Document saturation arithmetic and min/max fields (#817) @turbolent
v0.15.0
β Features
- Added balance fields on accounts (#808) @janezpodhostnik
- Add address field to capabilities (#736) @ceelo777
- Add array appendAll function (#727) @lkadian
- Validate arguments passed into cadence programs (#724) @SupunS
- Implement equality for storable values and static types (#790) @turbolent
- Declare min/max fields for integer and fixed-point types (#803) @turbolent
- Add saturation arithmetic (#804) @turbolent
- Add functions to read stored and linked values (#812) @turbolent
π Improvements
- Optimize storage format (#797) @fxamacker
- Paralleize encoding (#731) @zhangchiqing
- Deny removing contracts if contract update validation is enabled (#792) @SupunS
- Simplify function types (#802) @turbolent
- Cache capability type members (#799) @turbolent
- Use force expression's end position in force nil error (#789) @turbolent
- Handle cyclic references in dynamic type conformance check (#787) @SupunS
- Benchmark CBOR encoding/decoding using mainnet data (#783) @fxamacker
- Extend defensive run-time checking to all value transfers (#784) @turbolent
- Remove obsolete code in decode.go (#788) @fxamacker
- Optimize encoding of 12 types still using CBOR map (#778) @fxamacker
- Reject indirect incompatible updates to composite declarations (#772) @SupunS
- Panic with a dedicated error when a member access results in no value (#768) @turbolent
- Update language server to Cadence v0.14.4 (#767) @turbolent
- Improve value type conformance check (#776) @turbolent
- Add validation for enum cases during contract updates (#762) @SupunS
- Optimize encoding of composites (#761) @fxamacker
- Improve state decoding tool (#759) @turbolent
- Optimize encoding of dictionaries (#752) @fxamacker
- Prepare Decoder for storage format v4 (#746) @fxamacker
- Make numeric types singleton (#732) @SupunS
- Validate arguments passed into cadence programs (#724) @SupunS
- Use location ID as key for maps holding account codes (#723) @turbolent
- Make native composite types non-storable (#713) @turbolent
- Improve state decoding tool (#798) @turbolent
- Remove unused storage key handler (#811) @turbolent
π Bug Fixes
- Extend defensive run-time checking to all value transfers (#784) @turbolent
- Fix borrowing (#782) @turbolent
- Prevent cyclic imports (#809) @turbolent
- Clean up "storage removal" index expression (#769) @turbolent
- Get resource owner from host environment (#770) @SupunS
- Handle field initialization using force-move assignment (#741) @turbolent
- Fix error range when reporting a type error for an indexing reference expression (#719) @turbolent
π Documentation
- Improve documentation for block timestamp (#775) @turbolent
- Document run-time type identifiers (#750) @turbolent
- Add documentation for the getType() builtin method (#737) @SupunS
v0.14.5
v0.14.4
β Features
π Bug Fixes
- Fix runtime representation of native HashAlgorithm/SignAlgorithm enums (#725) @SupunS
- Fix error range when reporting a type error for an indexing reference expression (#719) @turbolent
π§ͺ Tests
- Benchmark real fungible token transfers (#722) @turbolent
- Use location ID as key for maps holding account codes (#723) @turbolent
v0.13.10
v0.13.9
v0.14.3
π Improvements
- Lazily load contract values (#715) @turbolent
- Make native composite types non-storable (#713) @turbolent
- Ensure imported checkers/elaborations are reused in tests' import handlers (#711) @turbolent
- Use require.ErrorAs (#714) @turbolent
π Bug Fixes
- Add support for access(account) and multiple contracts per account (#710) @turbolent