* CHANGELOG_BEGIN
Added filterA to Prelude.
* Update compiler/damlc/daml-stdlib-src/DA/Internal/Prelude.daml
Co-authored-by: Shayne Fletcher <shayne@shaynefletcher.org>
* Removed not so useful comment.
* Moved filterA from Prelude to Action.
* filterA is a one-liner now.
* Provided more meaningful example to filterA.
* Added test for filterA.
* Removed failing doctest.
CHANGELOG_END
Co-authored-by: Shayne Fletcher <shayne@shaynefletcher.org>
Speedy: run() dont step()
- Running the Speedy machine with `run()` instead of `step()`
- Remove: `SResultContinue`
- Add: `SResultFinalValue(_)`
We change the top level control of Speedy: from machine.step() to machine.run, with the control of stepping while the machine returns SResultContinue moved into speedy itself. (And so SResultContinue is removed in favour of SResultFinalValue.) The main advantage of this approach is that the tight while loop can be moved inside the exception handler, rather than having to wrap the handler every step.
changelog_begin
changelog_end
* Integrate PostCommitValidation with JdbcLedgerDao and SqlLedger
Closes#5035Closes#5663
changelog_begin
[Sandbox] Skip unnecessary double post-commit validation inherited by sandbox-classic, expect performance improvement
changelog_end
* Ensure SqlLedger recovers from failures and logs them when publishing a transaction
* Remove unused import
* Remove tests for ledger entries
* Fix completions test to make them compile
* Fix compilation errors in tests, address self-review items, apply necessary fixes
- address https://github.com/digital-asset/daml/pull/5781#pullrequestreview-403293667
- address https://github.com/digital-asset/daml/pull/5781#pullrequestreview-403378192
* Pass TransactionTimeModelComplianceIT
* Minor tweaks to variable naming
* Fix failing tests
* Stop deduplicating commands on failures
* Attempt at making sandbox-classic allocate parties implicitly
* Remove implicit party allocation test (without full server) for SQL backed sandbox-classic
* Removing ImplicitPartyAdditionIT (covered in conformance tests)
* Add migrations
* Fix test for ledger DAO with post-commit validation against PostgreSQL
* Update PostgresIT
* Fix missing/wrong items from previous commits
* Don't perform batch processing of enqueued persistence entries
* Rebase against master
Currently, there are quite a few releases that are lacking the
Standard-Change label, even though they did publish artifacts. This
makes our SOC2-compliance tracking a bit harder. For the past two
months, I have manually added the label after-the-fact while preparing
the monthly compliance report, but that doesn't seem like a great
solution.
This PR changes the release process to be more optimistic: assume the
release is going to succeed by putting in the label immediately, and
then (optionally) removing it if the release fails.
Note that the label should only be removed in the rare case where the
release was merged into master but somehow did not produce any artifact.
This can only happen if the Linux build fails quite early, which as far
as I know only happened once over the past two months when we had the
release notes race condition.
CHANGELOG_BEGIN
CHANGELOG_END
* Sandbox: expose back pressure config in CLI
CHANGELOG_BEGIN
[Sandbox]: Added ``--max-commands-in-flight`` as CLI configs. See ``daml sandbox --help``.
[Sandbox Classic]: Added ``--max-commands-in-flight`` and
``--max-parallel-submissions`` as CLI configs. See ``daml sandbox-classic --help``.
CHANGELOG_END
* Bumping the default maxParallelSubmissions to 512 for sandbox classic
We used to use `maxCommandsInFlight * 2` in SqlServer, but it makes more
sense to use `maxParallelSubmissions` there. Since the lower default value of 128
would result in the conformance tests to fail, I'm bumping it to 512
* Use maxCommandsInFlight to configure the parallel submissions for CommandService
* Add a reason text field to RejectReason.Inconsistent (#5180)
CHANGELOG_BEGIN
- Add a reason text field to RejectReason.Inconsistent.
See `#5810 <https://github.com/digital-asset/daml/issues/5810>`__.
CHANGELOG_END
* Change wording in contributing instructions to reflect best practice (#5820)
* Also make add reason text to other reject reasons that don't have it (#5820)
* Update with review comments (#5820)
* Update with review comments (#5820)
* Update with review comments (#5820)
* Fix handling of packages in damlc visual
Previously we just ran the analysis on the modules of the main
package. This failed for obvious reasons as soon as you reference a
template from another package which happens pretty
frequently (e.g. for anything that uses finlib).
This PR fixes this to run the analysis on the whole World which is
self-contained. This required a bunch of reshuffling to make sure that
we always reference fully qualified identifiers but most of it is
very mechanical.
Note that currently you cannot distinguish between templates with
identical names in the resulting graph (they will be separate but you
have no idea which one is which). This was already an issue
before if you have the same template name in different modules so I
consider this an orthogonal issue.
This fixes the expected failure we already had and I added another
test that checks that colliding template names do at least show up as
separate nodes in the graph. I also manually tested this against
ex-bond-issuance.
Disclaimier: I’m aware that the code is very messy but I tried to
resist the urge to rewrite it completely and only change what was
necessary.
fixes#5776
changelog_begin
- [DAML Compiler] ``damlc visual`` now works properly in projects
consisting of multiple packages.
changelog_end
* Rename templateChoiceId to templateId
changelog_begin
changelog_end
The two functions to convert between text and a list of codepoints
were documented the wrong way around. This PR fixes the issue. We
also sprinkle in a few plural "s" where needed.
CHANGELOG_BEGIN
CHANGELOG_END
All functions in `DA.Numeric` take the scale of the result as their
first type argument. IMO, this is a nice API since you usually only
want to specify the scale of the result since the scale of the
term arguments is most of the times inferred.
However, the current type signatures in `DA.Numeric` bear quite some
risk of being confusing. For instance, in
```haskell
mul : NumericScale n3 => Numeric n1 -> Numeric n2 -> Numeric n3
```
the naming of the type variables suggests that the order of the
type parameters is `n1 n2 n3` when it actually is `n3 n1 n2`.
I consider the knowledge of implicit `forall`s are filled in quite
expert and hence think we should make the order of these type arguments
explicit.
There is also a related mistake in the docs of `shift`. Running a
scenario confirmed that
```haskell
shift @1 @2 1.0 == 10.0
```
Hence, `shift` has multiplied its argument by `10^(2-1)`, which is
`10^(n1 - n2)`.
CHANGELOG_BEGIN
CHANGELOG_END
* resize elements of containers by 1/3 in TypedValueGenerators
- no explosions in 2m samples
* use Order.apply
* resize key types of GenMaps more vigorously
- At max 100, the default, max size of a key *type* is 10, key size 33
* revert most of "reduce test count for Ordering tests (#5741)" 00025a5337
CHANGELOG_BEGIN
CHANGELOG_END
- Only upload packages during the initial startup.
- Avoid loading packages during subsequent resets
- Share an engine between Ledger API Server and Committer
* Use a randomized H2 URL to simular in-memory
The reset service test assumes to get a completely new ledger for each
test case. But because we use H2 in-memory with db_close_delay=1 and the
same H2 database name, the second test case gets the remnants of the
first test case.
Since we know that sandbox in-memory uses an H2 in-memory URL, we can
simply use SandboxBackend.H2Database for ResetServiceInMemoryIT.
CHANGELOG_BEGIN
[Sandbox] Drastically lower the time needed to do a reset via the
ResetService.
CHANGELOG_END
With the current setup, we always push whatever version GitHub considers
as the latest, which is defined by date. This means that at the moment a
patch release could overwrite a less recent but higher-version release,
essentially downgrading the SDK to a previous, presumably less good user
experience.
This patches the upload process to choose the highest-numbered release
instead of the most recent one by date.
CHANGELOG_BEGIN
CHANGELOG_END
CWD will be set to the same execroot for all targets on Windows. While
this will contain the things we are searching for it contains a whole
bunch of other stuff and in particular it can also change during the
execution of `find`. This resulted in errors with temporary files such
as the local-spawn-runner-* stuff that appear and disappear while
find is running.
This PR switches it to a tmp dir which works around this issue and
makes more sense anyway since we clearly don’t want to search in the
whole execroot.
changelog_begin
changelog_end
At the moment, collect_build_data will wait for the Windows
compatibility test to have "finished", but doesn't check its return
status. This means two things:
1. Should the compatibility test end without a success or error (e.g.
communication broken between Azure and the node), the option to rerun
failed jobs will not appear, as there will be no failed job.
2. The subsequent notify_user step will ignore failures in the
compatibility_windows job when reporting to Slack, making for
confusing reports.
CHANGELOG_BEGIN
CHANGELOG_END
With the change in release model (VERSION to LATEST), I forgot to change
the workspace_status script. The result is that our sitemap will forever
indicate all the pages in the docs have been last modified on Feb 25,
discouraging search engines from indexing them again at any point since.
This PR fixes that by updating the workspace_status script, which
hopefully should result in search engines indexing us again.
CHANGELOG_BEGIN
CHANGELOG_END
* nuke the Bazel cache
This is a bit of a nuclear option as we cannot figure out how to repair
the cache in place. It seems (somewhat) clear that the cache is
corrupted for Windows builds, but we're out of ideas on either how to
test it to fully confirm or how to repair it.
This PR will consist of two commits: one with the Bazel cache definition
commented out (this one), and then one that reverts it. This will result
in a no-change commit when squashed on master, but should serve as an
audit trail for the accompanying Standard Change (as I consider dropping
the entire cache outside of routine maintenance).
CHANGELOG_BEGIN
CHANGELOG_END
* run Windows build with no Linux node
Normally our Windows builds only start after a Linux node has run the
`check_for_release` step. This commit bypâsses that so this PR can run
while all the other ones are stuck in the Linux queue.
* Revert "nuke the Bazel cache"
This reverts commit f7cd68e080, recreating
the Bazel cache.
* populate macos cache and test Windows one
* revert all changes in this PR
* Endpoint to list all triggers (not yet by party)
* Clean up test code a little
changelog_begin
changelog_end
* Test for listing running triggers
* Respond with JSON list instead of random text
* List triggers by party
Pass party name in request body.
Store another map of party name to set of trigger ids.
Also store party names in the values of the original trigger id map, so
we can update the party map when stopping a trigger.
* Adjust PostCommitValidation
- do not require a party for validation (to validate divulged contracts)
- stop validation after first error and don't accumulate rejection reasons
- address 01da7393b3 (r416719399)
changelog_begin
changelog_end
* Use participant state rejection reasons, drop unused submitter parameter from validation
Instead of always benchmarking the hardcoded scenarios, we can now
pass a DAR and a scenario to the benchmark as well.
This is part of https://github.com/digital-asset/daml/issues/5746.
CHANGELOG_BEGIN
CHANGELOG_END
* new --leak-passwords-firesheep-style option; functions to check forwarded protocol
* enforce https reverse-proxy in all JWT-accepting endpoints
* make HttpService.start take config record
* test that X-Forwarded-Proto or Forwarded is enforced
* use new start signature in daml-script tests
* use insecure http mode for ts codegen tests
* note on regex
* use insecure option in daml assistant integration tests
* log allowNonHttps setting
* add non-https option to more places in daml-assistant tests
* add non-https option to getting started guide
* rename --leak-passwords-firesheep-style to --allow-insecure-tokens
- per suggestion by @garyverhaegen-da, @hurryabit
CHANGELOG_BEGIN
- [JSON API] By default, checks that connections are made through a reverse-proxy
providing HTTPS, ensuring that JWT tokens don't leak. To disable this check,
such as for development, pass ``--allow-insecure-tokens``.
See `issue #5572 <https://github.com/digital-asset/daml/issues/5572>`_.
CHANGELOG_END
* daml start includes --allow-insecure-tokens by default
- as indicated by @cocreature
This moves the code from the Shake testing module to a separate
module. This is required since the Shake test setup is not really
intended to test multiple packages. I’ve added a new test suite that
makes use of this and has an expected failure for the issue with
multiple packages. The issue is not actually fixed in this PR, I just
wanted to keep the refactoring separate since it is quite large and
noisy.
changelog_begin
changelog_end
* Implement replacement for post-commit validation
PostCommitValidation is meant as a replacement for ActiveLedgerState and
ActiveLedgerStateManager for JdbcLedgerDao so that the old table can eventually
be retired and post-commit validation can happen on the new participant schema.
This commit simply introduces the implementation and tests it in isolation.
Integration with the existing system will come in a separate contribution.
changelog_begin
changelog_end
* Address https://github.com/digital-asset/daml/pull/5737#discussion_r415918949
* Address https://github.com/digital-asset/daml/pull/5737#discussion_r415921207
* Add tests for the empty ledger scenario and introduce necessary fixes
* Add more tests for fetch and using some prior history
* Add tests for divulged contracts
* Use a custom Gen instead of Arbitrary, to generate nonempty Vec[Int],
the test could fail on empty input, it expects at least one input message
changelog_begin
changelog_end
* Address code review comments
* sandbox: Split up LedgerApiServer.
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox: Extract out API service construction from LedgerApiServer.
* sandbox: Pull out a case class for GrpcServerOwner event loop params.
* sandbox: Split ownership of `ApiServices` from the object.
* Make compat tests work on windows
This required some changes to the daml_sdk rule since the read-only
installation by the assistant breaks Bazel completely. We could only
apply those changes on Windows but I think I prefer the consistency
across platforms here over trying to stay close to how the SDK is
installed on user machines given that the SDK installation is not
something we’ve had issues with.
I’ve excluded the postgresql tests for now. I don’t expect them to be
particularly hard to fix but I’ve already spent almost 2 days on this
and having some tests run on Windows seems like a clear improvement
over running no tests on Windows :)
changelog_begin
changelog_end
* Remove todo
changelog_begin
changelog_end
We add a benchmark for running a sufficiently big scenario. This PR is
more about setting up the benchmarking infrastructure rather than the
actual benchmark itself.
This is part of https://github.com/digital-asset/daml/issues/5746.
CHANGELOG_BEGIN
CHANGELOG_END
I believe the compatibility check is important enough, and should fail
rarely enough, that it is worth reporting even on success. This will
mean (once we support Windows) 3 messages a day, sent while presumably
nobody is working, so the disruption should be minimal.
The issue with reporting only on failures is that, if we don't
proactively check (which we do for the state of master for different
reasons, but would likely not keep doing for a job that doesn't block
PRs), we may get into a state where it is so broken that it doesn't even
report.
CHANGELOG_BEGIN
CHANGELOG_END
This is a minor, cosmetic change. Note that all our references to
releases are based on tags, and do not depend on the release title. This
is evidenced by the fairly random titles we used to have before the
title was set by CI, see e.g.
[0.13.35](https://github.com/digital-asset/daml/releases/tag/v0.13.53).
CHANGELOG_BEGIN
CHANGELOG_END
In the call back of `SBUFetch` when asking the ledger for a contract the translateValue may raise an exception.
However it is not safe as the engine cannot recover such error.
We create a new Control for the speedy machine, that handle safely the translation.
CHANGELOG_BEGIN
CANGELOG_END
* reduce test count for Ordering tests
CHANGELOG_BEGIN
CHANGELOG_END
* changed the wrong one in ValueSpec; preserves base order is redundant for primitives
* extend visual for exerciseByKey
Fair warning: I have no idea what I'm doing here. Please review
carefully.
This commit extends the `daml damlc visual` command to draw a line for
exerciseByKey choices. This fixes#5726.
I have not been able to find any existing test for the visualizer. If
non exist, I think we should at least turn #5726 into a test case,
checking that the expected dot file gets generated. I suggest doing that
as a separate PR though.
If there is already a suite of tests, please point me to it and I'll
happily add one for this.
CHANGELOG_BEGIN
[Visualization] Fix a bug where `exerciseByKey` was not properly
recognized. See #5726.
CHANGELOG_END
* add test