Changelog History
Page 2
-
v0.13.55 Changes
March 18, 20200.13.55 - 2020-03-18
Summary
- π DAML Script is officially supported
- Action required by April 2020 if you use scenarios for Sandbox initialization
- DAML Repl is available as an experimental feature
- π Support for cross-SDK DAR Dependencies and Contract Upgrades
- Action required to mitigate an upcoming restriction to DAML type naming
- π Improved daml.yaml features
- More consistent APIs regarding contract visibility
- Potentially breaking change that is unlikely to affect any existing DAML applications
- π New command deduplication feature
- Action required by April 2020 if you rely on maximum record time for command deduplication
- π Security improvement
- Immediate action required to make SDK components continue to listen on external network interface
What's New
β DAML Script - A better way to initialize and test your ledger
Background
β Being able to script the interaction with a DAML ledger is useful for testing, application initialization, and even one-off operations in production use. DAML scenarios cover a subset of those uses: Realtime testing and feedback in the IDE and ledger initialization in the Sandbox in static time mode. The main drawback of scenarios is that outside of the IDE, they only work with the Sandbox in static time mode and only during ledger initialisation. We have, therefore, built DAML Script, which generalizes the concepts behind Scenarios to work for any DAML Ledger, at any time. Going forward, we will deprecate ledger initialization based on Scenarios, and we recommend users to start using DAML Script now.
Specific Changes
- π DAML Script is no longer experimental
- π
daml.yaml
now supports the specification of an initialization script via the init-script field, which is analogous to the scenario field. - DAML Script now works against ledgers with authentication with tokens passed in via the
--access-token-file
flag - π DAML Sandbox now shows a deprecation warning if a scenario is used for initialization
Impact and Migration
π Scenarios for Sandbox initialization will no longer be supported with the next SDK release in April 2020, but will continue to be supported for DAML model testing in the IDE and command line. If you are using a scenario to initialize the Sandbox today, we recommend migrating that to a DAML script. DAML Script has similar syntax to Scenarios. Take a look at the documentation for instructions on how to migrate from scenarios to DAML script.
Experimental: DAML Repl - Interactive DAML Script
Background
β We are introducing an interactive read-eval-print-loop (REPL) for interacting with a DAML ledger. This feature is analogous to using an interactive shell session to examine and change the data in a relational database. It is based on DAML Script and allows accessing all functions from your DAML code. We encourage you to test this feature and provide feedback. It is still marked as experimental, so we can incorporate your feedback effectively and efficiently.
Specific Changes
- Introduction of the
daml repl
cli command
Impact and Migration
π DAML Repl is an entirely new feature, and no changes to existing projects are needed. Please refer to the docs for more information on this new functionality.
β¬οΈ DAML-LF 1.8 brings cross-SDK upgrades and data dependencies
Background
π One of DAML's unique features is that the clear data ownership based on signatories allows for clean contract upgrades directly from within DAML. So far, this required SDK versions of the original and the new DAML contracts to be equal, a limitation that we obviously wanted to lift. This release lifts this restriction and adds support for contract migrations across SDK versions thanks to adding support for
data-dependencies
indaml.yaml
.π
dependencies
anddata-dependencies
are source and binary dependencies respectively.dependencies
should be used to include any libraries (e.g. the DAML Standard Library) that are always deployed together with the project, whereasdata-dependencies
should be used for any dependencies that are independently deployable, for example the DAML Finance Library, or applications already running on the target ledger.Specific Changes
- π
daml.yaml
now supports a section fordata-dependencies
in addition to dependencies - π The already deprecated
daml migrate
command has been removed - Data constructors for record types have to be the same as the type name.
Impact and Migration
β¬οΈ To make use of this feature, DAML projects have to be compiled to DAML-LF 1.8. The current default is still 1.7, and so this has to be done by passing in the flag
--target=1.8
. Detailed information on the upgrading and dependency functionality can be found in the docs.
Data constructors that donβt match record type names have to be renamed. For example, if you had a record typedata Foo = Bar with ..
, you need to change it todata Foo = Foo with ..
.More functionality in
daml.yaml
Background
π The project file
daml.yaml
should tell the DAML Assistant CLI everything it needs to know to set up a test environment using daml start. However, until this release, there were certain Sandbox, Navigator, and HTTP JSON API settings that needed to be set through additional command line flags. These can now be set usingsandbox-options
,navigator-options
andjson-api-options
sections indaml.yaml
.Specific Changes
- Items under the
sandbox-options
,navigator-options
andjson-api-options
sections indaml.yaml
are picked up by daml start and passed to the respective components.
Impact and Migration
π» Command line arguments like
daml start --sandbox-option="--wall-clock-time"
will keep working as before, but you can now simplify your CLI usage moving them intodaml.yaml
.Cleanup of some API services and components
Background
π Privacy is one of DAML's primary concerns, with visibility of data usually constrained to signatories and observers of contracts. However, there are two well-documented and controlled mechanisms through which non-observers can learn about contracts: Divulgence and Witnessing.
π± Whether events or contracts that are known due to those mechanisms are shown in APIs or tools used to be inconsistent and led to oddities such as the Navigator showing assets that had been transferred. This change addresses these inconsistencies and ensures divulged and witnessed contracts are only included in APIs returning transaction trees.
Specific Changes
- The Flat Transaction Service and Active Contract Service no longer include divulged and witnessed contracts
- The JSON API no longer includes divulged and witnessed contracts
- The Extractor no longer stores divulged and witnessed contracts and the column
contract.witness_parties
has been renamed tocontract.stakeholders
.
Impact and Migration
Applications are unlikely to be accidentally relying on the current behaviour so there is probably little to no impact on existing DAML applications. In general, if you want to share data on a DAML ledger, we recommend using the observer mechanism or sharing it in dedicated sharing contracts as highlighted in the Broadcast Example.
π New Command Deduplication Mechanism
Background
For certain applications, it is crucially important that commands will not be processed twice, even if application or ledger components crash or network links fail. The new command deduplication mechanism gives a way to achieve that.
π The previous mechanism based on Maximum Record Time (MRT) and Checkpoints on the CompletionStream was difficult to use in practice and didnβt generalise to ledgers without a linearly ordered record time. The new mechanism is designed to replace the old one over the course of the next DAML SDK releases.
Specific Changes
- The
Command
andCommandSubmission
services add adeduplication_time
parameter to commands during which no second command with thecommandId
can be submitted.
Impact and Migration
π The maximum record time based mechanism for command deduplication is now deprecated and will be removed with the next SDK release. We recommend switching from the MRT-based mechanism to
deduplication_time
based one. Detailed documentation here.Minor Improvements
JSON API
The JSON API has a new
/v1/create-and-exercise
endpoint that allows the submission of commands creating a contract and then immediately exercising a choice on it.The experimental websocket streaming version no longer sends a
{"live": true}
marker to indicate live data is starting. Instead, live data is indicated by the presence of an offset.The
/v1/parties
endpoint now allows POST requests, which expect a JSON array of party identifiers as input, and returns the corresponding party details.Language
- The pragma
daml 1.2
is now optional. This is in preparation for DAML SDK 1.0 from which time on the language wonβt be versioned independently from the SDK.Ledgers
π Rejected submissions are now logged at a lower "INFO" level to remove a source of warnings/errors without relation to server health.
π The Sandbox can now produce random ContractIds consistent with other ledger implementations. This can be activated using the flags
--contract-id-seeding=weak
or--contract-id-seeding=strong
. The weak version uses a less safe, non-blocking random number source.π Security
0οΈβ£ All services now bind to localhost (127.0.0.1) instead to all interfaces (0.0.0.0). This default can be overridden using command line flags:
- `daml sandbox --address 0.0.0.0` - `daml navigator 0.0.0.0 6865` - `daml json-api --address 0.0.0.0`
What's Next
π We are working towards the first stable DAML SDK release in April. The majority of work between now and then amounts to tidying up, cleaning up UX issues, reducing architectural debt, and removing deprecated features.
- π The Quickstart / Getting Started documentation will be overhauled
- The Ledger Time model will be upgraded so
ledger_effective_time
no longer needs to be supplied as part of command submission- Record time will no longer be guaranteed to be linearly ordered
- Maximum Record Time will be removed from the API
- Checkpoints will be removed from the CompletionStream
- The DAML Sandbox will have a new architecture much more closely aligned with other DAML Ledgers
- Contract Ids will be hashes rather than sequence numbers
- The default time mode will switch to wall-clock
- Ledger initialization via scenarios will be removed
- Ledger Offsets will no longer be sequence numbers, but instead increasing integers
- Maven artifacts will be versioned in line with the SDK
- DAML will get a generic Map type to replace the current TextMap
- π DAML Script is officially supported
-
v0.13.54 Changes
February 20, 2020Sandbox
- β Removed the warnings regarding static time and scenarios on
π initialization. We will not deprecate these until we have a stable
alternative. - If no ledger ID is provided when running against an existing ledger,
π use the existing ID. Previously, Sandbox would fail to start.
DAML Standard Library
- β Add
subtractDays
to the DAML Standard Library.
- β Removed the warnings regarding static time and scenarios on
-
v0.13.53 Changes
February 19, 2020DAML Stdlib
Restrict the
(>>)
operator to instances ofAction
and make it lazy in its second argument. This gives expressions of the formdo A; B
the desirable semantics of only runningB
whenA
is a successful action.β Remove the
Action
andActionFail
instances forValidation
inDA.Validation
. Please enable theApplicativeDo
language extension if you want to useValidation
withdo
-notation and replacefail
withDA.Validation.invalid
.DAML Ledger Integration Kit
Enforce that all parties referenced as stakeholders, actors, or maintainers in a transaction have been allocated.
β‘οΈ Ledger API Test Tool default tests modified. Use
--list
for the updated list of default tests. Time service test dropped from the suite.Sandbox
π Static time mode is being deprecated in the future. A warning has been added to notify users of this fact.
β Scenarios for ledger initialization are being deprecated in the future, in favor of DAML Script. A warning has been added to notify users of this fact. Scenarios can still be used for testing in DAML studio.
Participant index contract lookups simplified. This should speed up command interpretation.
If authentication is enabled, requests without a valid authentication are going to be rejected with an
UNAUTHENTICATED
return code instead ofPERMISSION_DENIED
.JSON API - Experimental
- β Add
{"live": true}
to WebSocket streams to mark the beginning of "live" data. See #4461. This marker is a placeholder feature; issue #4509 bookmarks in query streams will obsolete this marker, after which it will no longer be emitted. When building features on the marker, be aware of this forthcoming replacement.
DAML Standard Library
- β Add a
subtract
function which is useful as a replacement for sections of(-)
, e.g.,subtract 1
is equivalent to\x -> x - 1
.
- β Add
-
v0.13.52 Changes
February 12, 2020DAML Assistant
The assistant can now do completions for SDK commands, e.g.,
daml ledger upl<TAB>
will complete todaml ledger upload-dar
.The new behavior introduced in
0.13.51
to shut down when stdin is closed is now disabled unless you explicitly enable it by passing--shutdown-stdin-close
.DAML Script - Experimental
0οΈβ£ The time mode must now always be specified explicitly. Use
--static-time
to recover the previous default time mode.β Add a sleep function that pauses the script for the given duration. This is primarily useful in tests where you repeatedly call query until a certain state is reached.
β Add a
HasTime
instance forScript
which allows you to get the current time (UTC in wallclock mode, UNIX epoch otherwise)DAML SDK
- π Fix computation of witnesses of top-level fetch nodes in scenario results ("known to").
DAML Studio
- π You can now open DAML Studio in the root of a multi-package project instead of opening it separately for each package. Take a look at the documentation for details on how to set this up.
DAML Triggers - Experimental
- 0οΈβ£ The time mode must now always be specified explicitly. Use
--static-time
to recover the previous default time mode.
JSON API - Experimental
π wrap Streaming API events in JSON object:
{ "events": [E1, E2, ...] }
. See issue #4384.π The format of
archived
responses from WebSocket endpoints has changed to include template IDs, similar to exercise responses. See issue #4383.π Rename JSON API endpoints. See issue #4289 and issue #3145.
/command/create => /v1/create /command/exercise => /v1/exercise /contracts/lookup => /v1/fetch /contracts/search => /v1/query /contracts/searchForever => /v1/stream/query /contracts/lookupForever => /v1/stream/fetch /parties => /v1/parties
π Exercise response field "contracts" renamed to "events". See issue #4385.
β Added streaming version of fetch by key:
/stream/fetch
. See issue #4705.π
/contracts/searchForever
accepts multiple queries, and includes with eachcreated
result thematchedQueries
indicating which queries matched. See issue #4363.Sandbox
π Fixed a memory leak when using the ResetService; not everything was cleaned up correctly.
Preliminary work to rebuild Sandbox on top of the DAML Ledger Integration Kit. Currently not exposed through the CLI.
-
v0.13.51 Changes
February 05, 2020JSON API - Experimental
- In websocket endpoints, if a
created
andarchived
contract
in the same result array share a contract key, thearchived
is
π guaranteed to occur earlier in the array than thecreated
. See
issue #4354.
DAML Assistant
- Bash and Zsh completions will now fall back to regular file
completions after the command argument. - The DAML assistant will now shut down long-running processes like
daml sandbox
when stdin is closed. This is mainly useful on
π Windows, where process APIs often kill the process in a way that
does not allow it to do any cleanup, in particular, we cannot stop
child processes.
KVUtils
- β Added a test case to the participant state tests to ensure your
ledger state is resumable upon restart.
Sandbox
- π Fix an error that stops the server from exiting cleanly if API
server initialization fails.
DAML Stdlib
- β Added
partition
function to prelude.
π Documentation
- β‘οΈ Updated roadmap to reflect the current state.
- In websocket endpoints, if a
-
v0.13.50 Changes
January 30, 2020DAML Compiler
- π¦
damlc test
now initializes the packagedb automatically which means
that it will work on projects that declare customdependencies
in
daml.yaml
without having to calldamlc init
first. - Choices marked explicitly as
preconsuming
are now equivalent to a
nonconsuming
choice that callsarchive self
at the beginning.
DAML Integration Kit
- The simplified kvutils API now uses
com.digitalasset.resources
to
manage acquiring and releasing resources instead ofCloseable
.
DAML Standard Library
- β Add
CanAbort
instance forEither Text
.
DAML Studio
- π Support all
build-options
supported bydaml build
.
Sandbox
- On initialization error, report the error correctly and exit with a
status code of 1. Previously, the program would hang indefinitely.
(This regression was introduced in v0.13.41.) - β¬οΈ Upgrade the Flyway database migrations library from v5 to v6.
DAML Triggers - Experimental
- β
DAML triggers can now be tested in scenarios. Specifically, a
trigger'srule
can be executed in a scenario and assertions
performed on the emitted commands.
- π¦
-
v0.13.49
January 30, 2020 -
v0.13.46 Changes
January 22, 2020Sandbox
π° The sandbox uses a new payload format for authentication tokens (JWTs). The old format is
π deprecated, but still works.Metrics are now namespaced by
"daml"
and their names have been standardized to snake_case.DAML Studio
Scenarios with unserializable result types no longer crash the scenario service.
π Fix a bug introduced in 0.13.43 that caused DAML studio to stop responding after code completions were requested.
DAML-LF
- Prohibit contract IDs in contract keys completely. Previously, creating keys containing absolute (but not relative) contract IDs was allowed, but
lookupByKey
on such a key would crash.
DAML Compiler
- β Added a
--drop-orphan-instances
flag indaml damlc docs
. - π The modification times in a DAR are now fixed to a given value which makes the output of
daml build
deterministic in single-threaded mode (which is the default).
JSON API - Experimental
- π° The HTTP JSON API now uses the same payload format for authentication tokens as the sandbox. The
π old format is deprecated, but still works. - π Support Exercise by Key. See issue #4099 .
- π Response format in
searchForever
changed to be more likeexercise
. See issue #4072 . - In 'search' endpoint arguments, %templates is now templateIds.
β Additionally, all contract query fields must occur under 'query'. See issue #3450 . - π WebSocket contract search at
/contracts/searchForever
. See issue #3936 .
Indexer
- Potentially fix a bug when recovering from failure.
DAML Standard Library
- The
Template
,Choice
, andTemplateKey
typeclasses have been split up into many small typeclasses to improve forward compatibility of DAML models.Template
,Choice
andTemplateKey
constraints can still be used as before.
Ledger API Server
- Publish the resource management code as a library under
com.digitalasset:resources
.
Ledger API Authorization
- π Support EC256 and EC512 algorithms for JWT
- Prohibit contract IDs in contract keys completely. Previously, creating keys containing absolute (but not relative) contract IDs was allowed, but
-
v0.13.43 Changes
January 15, 2020DAML Compiler
- π The
build-options
field fromdaml.yaml
is now also respected
when--project-root
is used.
DAML SDK
- π Docker images for this release and releases in the future are built
π³ using the Dockerfile of the corresponding git tag and are therefore
β‘οΈ stable. Previously, they were updated whenever the Dockerfile
π changed.
Ledger API Server
- π₯ BREAKING CHANGE
lookupByKey
now requires the submitter to be a
π stakeholder on the referenced contract. See issue
#2311 and
issue #3543. - β‘οΈ Metrics: Update dropwizard to version 4.1.2.
- π Authorization: Support elliptic curve algorithm for JWT
verification.
Sandbox
- π Allow
submitMustFail
in scenarios used for sandbox initialization. - Loosen database schema to allow persistence of transaction ledger
entries where no submitter info is present (typically when the
submitter is hosted by another participant node). - π DAML trace logs (trace, traceRaw, traceId) are now logged via the
π² regular logging system (slf4j+logback) at interpretation time via
the loggerdaml.tracelog
at DEBUG level. - π Fix bug that can cause the transaction stream to not terminate. See
issue #3984.
DAML Triggers - Experimental
- π§ You can now configure a heartbeat message to be sent at a regular
time interval.
JSON API - Experimental
The
/contracts/search
endpoint reports unresolved template IDs as
π warnings. See [issue3771](https://github.com/digital-asset/daml/issues/3771).
π Use JSON string to encode template IDs. Use colon (
:
) to separate
π¦ parts of the ID. The request format, with optional package ID:"<module>:<entity>"
- π¦
"<package ID>:<module>:<entity>"
The response always contains
fully qualified template ID in the format: - π
"<package ID>:<module>:<entity>"
See issue
#3647.
- π¦
Align
contract
table withdomain.ActiveContract
class. The
database schema has changed, if using--query-store-jdbc-config
,
π you must rebuild the database by adding,createSchema=true
. See
issue #3754.π The
witnessParties
field is removed from all JSON responses. - π The
-
v0.13.42 Changes
January 08, 2020JSON API - Experimental
- π Rename
argument
in active contract topayload
. See #3826. - π Change variant JSON encoding. The new format is
{ tag: data-constructor, value: argument }
.
For example, if we have:data Foo = Bar Int | Baz
, these are all valid JSON encodings for
values of type Foo:{"tag": "Bar", "value": 42}
{"tag": "Baz", "value": {}}
π See #3622
- π Fix
/contracts/lookup
find by contract key. - π Fix
/command/exercise
to support any LF type as a choice argument.
π See #3390
DAML Compiler
π¦ Move more types from daml-stdlib to standalone LF packages. The module names for the types have
also changed slightly. This only matters over the Ledger API when you specify the module name
explicitly. In DAML you should continue to use the existing module names.- The types from
DA.Semigroup
are now in a separate package under
DA.Semigroup.Types
- The types from
DA.Monoid
are now in a separate package under
DA.Monoid.Types
- The types from
DA.Time
are now in a separate package under
DA.Time.Types
- The types from
DA.Validation
are now in a separate package
underDA.Validation.Types
- The types from
DA.Logic
are now in a separate package under
DA.Logic.Types
- The types from
DA.Date
are now in a separate package under
DA.Date.Types
. - The
Down
type fromDA.Internal.Prelude
is now in a separate
π¦ package underDA.Internal.Down
.
DAML SDK
- π
daml damlc docs
now accepts a--exclude-instances
option to exclude unwanted instance docs
by class name.
DAML-ON-X-SERVER
- 0οΈβ£ Made ledger api server to bind to localhost by default instead to the public
π interface for security reasons.
DAML Assistant
Bash completions for the DAML assistant are now available via
daml install
. These will be
π§ installed automatically on Linux and Mac. If you use bash and have bash completions installed,
these bash completions let you use the tab key to autocomplete many DAML Assistant commands, such
asdaml install
anddaml version
.Zsh completions for the DAML Assistant are now installed as part of
daml install
. To activate
them you need to add~/.daml/zsh
to your$fpath
, e.g., by addingfpath=(~/.daml/zsh $fpath)
to the beginning of your~/.zshrc
before you callcompinit
.DAML Script - Experimental
π are you sure you are actually using bash? iirc macos switched the default to
- π Allow running DAML scripts as test-cases. Executing
daml test-script --dar mydar.dar
will
β execute all definitions matching the typeScript a
as test-cases.
π See #3687.
Reference v2
- π» On an exception, shut down everything and crash.
Previously, the server would stay in a half-running state.
- π Rename