|
| 1 | +# Release of Daml SDK 3.3.0 |
| 2 | + |
| 3 | +## What’s New |
| 4 | + |
| 5 | +### Smart Contract Upgrading |
| 6 | + |
| 7 | +The Smart Contract Upgrade feature enables fixing application bugs or extending Daml models is possible without downtime |
| 8 | +or breaking Daml clients. It was introduced in Daml v2.9.1 and is now available in Daml and Canton 3.3. |
| 9 | + |
| 10 | +This feature is well-suited for developing and rolling out incremental template updates. There are guidelines to ensure |
| 11 | +upgrade compatibility between DAR files. The compatibility is checked at compile time, DAR upload time, and runtime. |
| 12 | +This is to ensure data backwards compatibility and forward compatibility (subject to the guidelines being followed) |
| 13 | +so that DARs can be safely upgraded to new versions. It also prevents unexpected data loss if a runtime downgrade occurs |
| 14 | +(e.g., a ledger client is using template version 1.0.0 while the participant node has the newer version 1.1.0). |
| 15 | + |
| 16 | +### Time boundaries functions |
| 17 | + |
| 18 | +Time boundaries functions allow constructing time assertions in Daml that are valid over a long period of time. |
| 19 | +- Ledger time bound checking predicates: ``isLedgerTimeLT``, ``isLedgerTimeLE``, ``isLedgerTimeGT`` and ``isLedgerTimeGE`` |
| 20 | +- Ledger time deadline assertions: ``assertWithinDeadline`` and ``assertDeadlineExceeded``. |
| 21 | + |
| 22 | +### Crypto primitives |
| 23 | + |
| 24 | +New crypto primitives simplify manipulation of data encoded into hex strings and introduce routines to calculate |
| 25 | +hashes and validate signatures over a block of encoded data. |
| 26 | +- Introduced Daml data type ``BytesHex`` supported via type classes ``HasToHex`` and ``HasFromHex``. |
| 27 | +- ``BytesHex`` support for base 16 encoded byte strings: ``isHex``, ``byteCount``, ``packHexBytes`` and ``sliceHexBytes`` |
| 28 | +- ``Bytes32Hex`` support for base 16 encoded byte strings of length 32: ``isBytes32Hex``, ``minBytes32Hex`` and |
| 29 | +``maxBytes32Hex``. |
| 30 | +- ``UInt32Hex`` support for base 16 encoded byte strings representing UInt32: ``isUInt32Hex``, ``minUInt32Hex`` and |
| 31 | +``maxUInt32Hex``. |
| 32 | +- ``UInt64Hex`` support for base 16 encoded byte strings representing UInt64: ``isUInt64Hex``, ``minUInt64Hex`` and |
| 33 | +``maxUInt64Hex``. |
| 34 | +- ``UInt256Hex`` support for base 16 encoded byte strings representing UInt256: ``isUInt256Hex``, ``minUInt256Hex`` and |
| 35 | +``maxUInt256Hex``. |
| 36 | +- ``keccak256`` support creation of KECCAK256 hash of the UTF8 bytes. |
| 37 | +- ``secp256k1`` support validation the SECP256K1 signature given a hex encoded message and a hex encoded DER formatted |
| 38 | +public key. |
| 39 | + |
| 40 | +## Breaking Changes |
| 41 | + |
| 42 | +## Functional Changes |
| 43 | + |
| 44 | +### Daml Script |
| 45 | + |
| 46 | +- ``allocatePartyWithHint`` has been deprecated and replaced with ``allocatePartyByHint``. Parties can no longer have |
| 47 | +a display name that differs from the ``PartyHint``. |
| 48 | +- ``daml-script`` is now a utility package: the datatypes it defines |
| 49 | +cannot be used as template or choice parameters, and it is transparent to upgrades. It is strongly discouraged to upload |
| 50 | +``daml-script`` to a production ledger but this change ensures that it is harmless. |
| 51 | +- The ``daml-script`` library in Daml 3.3 is Daml 3’s name for ``daml-script-lts`` in Canton 2.10 (renamed from |
| 52 | +``daml3-script`` in 3.2). The old ``daml-script`` library of Canton 3.2 no longer exists. |
| 53 | +- ``daml-script`` exposes a new |
| 54 | +``prefetchKey`` option for submissions. See here. |
| 55 | + |
| 56 | +### Standard library changes |
| 57 | + |
| 58 | +- New ``Bounded`` instances for ``Numeric`` and ``Time``. |
| 59 | +- ``TextMap`` is no longer deprecated |
| 60 | +- Added ``Map.singleton`` and ``TextMap.singleton`` functions. |
| 61 | +- Added ``List.mapWithIndex``. |
| 62 | +- Added ``Functor.<$$>``. |
| 63 | +- Added ``Text.isNotEmpty``. |
| 64 | + |
| 65 | +### Language changes |
| 66 | + |
| 67 | +- New alternative syntax for implementing interfaces: one can now write implements ``I where ...`` |
| 68 | +instead of ``interface instance I for T where ...`` |
| 69 | + |
| 70 | + |
| 71 | +### Daml assistant changes |
| 72 | + |
| 73 | +- Fixed an issue with ``daml build –all`` failing to find ``multi-package.yaml`` when in a directory below a ``daml.yaml`` |
| 74 | +- The ``daml package`` and ``daml merge-dars`` commands no longer exist. |
| 75 | +- The ``daml start`` command no longer supports hot reload as this feature is incompatible with Smart Contract Upgrades. |
| 76 | +- Added a new multi-package project template called ``multi-package-example`` to the daml assistant. |
| 77 | + |
| 78 | +### Daml compiler changes |
| 79 | + |
| 80 | +- The compiler now emits warnings for unused dependencies. |
| 81 | +- Added flags for turning warnings about expressions into errors. |
| 82 | +- The ``bad-{exceptions,interface-instances}`` and ``warn-large-tuples`` flags no longer exist. |
| 83 | + |
| 84 | +### Code generation changes |
| 85 | + |
| 86 | +- In typescript-generated code, ``undefined`` is now accepted by functions expecting an optional value and is understood |
| 87 | +to mean ``None``. |
| 88 | +- Typescript code generation no longer emits code for utility packages: these packages don’t expose any serializable |
| 89 | +type and thus will never be interacted with through the ledger API. |
| 90 | +- Java codegen now exposes additional fields in the class representing an interface. Next to ``TEMPLATE_ID`` there is |
| 91 | +``INTERFACE_ID`` and next to ``TEMPLATE_ID_WITH_PACKAGE_ID`` there is ``INTERFACE_ID_WITH_PACKAGE_ID``. Both field pairs |
| 92 | +contain the same value. |
| 93 | + |
| 94 | +### Miscellaneous |
| 95 | + |
| 96 | +- The Daml SDK is now compiled against open JDK 17 |
| 97 | +- Added transaction traces |
0 commit comments