Compact compiler 0.23.0 (Compact language 0.15.0)
Compact compiler 0.23.0 (Compact language 0.15.0) release notes
Today we are releasing version 0.23.0 of the Compact compiler. This release updates the Compact language from version 0.14.0 to 0.15.0. The new version of the compiler goes along with the upcoming Midnight testnet upgrade.
The testnet upgrade is a breaking change: contracts must be compiled with version 0.23.0 or later of the Compact compiler to work with the upgraded testnet network. Part of the upgrade to the network is a change to the proof system that requires new prover and verifier keys, which are generated from your contracts by the Compact compiler.
The compiler uses a separate binary file (zkir) to generate prover and
verifier keys. If you see the error message error: unrecognized subcommand 'compile-many' from the compiler, that indicates it is using an incompatible
version of the zkir binary. Ensure that the zkir binary found in your path
is the one that came with compiler version 0.23.0.
There are some language changes in this release as well, which is why the Compact language version has been incremented to version 0.15.
This release also includes a number of bug fixes and compiler improvements, which are additionally described below.
Summary of Changes
This release includes some language changes:
- [Breaking] The maximum
Fieldvalue has changed - [Non-breaking] Trailing commas and semicolons are now allowed in more places
In addition, this release includes the following bug fixes:
- Fix for incorrect
Fieldarithmetic overflow and underflow - Fix for a crash due to incorrect common subexpression elimination
- Fix for a crash when trying to cast to a ledger ADT type
- Fix for crashes involving large integer literals
We have made improvements to the way that the compiler works:
- There is a progress meter during key generation
- The compiler now removes stale ZKIR files
- Better error message when a developer attempts to use division
Language Updates
This release includes a couple of changes to the Compact language. If you write contracts that rely on either of the two features described below, you can specifically request Compact language version 0.15 with:
pragma language_version 0.15;
[Breaking] The maximum Field value has changed
The Midnight testnet upgrade includes a change to the ZK-proof system. The
elliptic curve used to generate zkSNARKS is switched from Pluto-Eris to
BLS12-381. A consequence of this switch for the Compact language is that the
maximum field value (available from your DApp's TypeScript code as MAX_FIELD)
has changed.
This is a breaking change. You may have to change your contracts if they relied on this value.