Commit Graph

4718 Commits

Author SHA1 Message Date
Andreas Herrmann
ae65f93e01
DAML REPL - Explicit package imports (#6707)
* DAML REPL - Explicit package imports

changelog_begin
- [DAML REPL] The REPL no longer imports all modules from the main DALFs
  of all specified DARs automatically at start-up. Instead, the REPL
  will only import modules from packages specified on the command-line
  using the `--import` flag.
changelog_end

* Accept package-name or package-id

* REPL test case for --import flag

* DAML REPL use `UnitId` for import packages

Addressing review comment
https://github.com/digital-asset/daml/pull/6707#discussion_r453731353

* DAML REPL Parse package-name/id at CLI

* DAML REPL Simplify unversioned pkgs

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-14 11:38:23 +00:00
fabiotudone-da
3f2938ecf6
Add KVUtils pre-execution round-trip test (#6671)
* Round-trip pre-execution tests for all committers

* Address review comments

* Address review comments
2020-07-14 09:29:07 +00:00
Moritz Kiefer
414ad8afdb
Type nested decoders with type arguments in daml2js (#6680)
Turns out you can easily intersect function types with object literals
to get what we want here.

While I am very annoyed by it, I don’t know how to write a test for
this. Afaik I can only test this by writing something that hits the
decoder directly but that doesn’t work since it’s impossible (afaik)
to write DAML code that generates DAML-LF that uses the nested type
directly in some API-relevant position (choice arg/return type, key
type, …). Of course, I could handwrite some DAML-LF but only Rémy is
allowed to do that.

changelog_begin
changelog_end
2020-07-14 09:03:32 +02:00
Moritz Kiefer
741c89784b
Support an empty list of DARs in DAML REPL (#6710)
changelog_begin

- [DAML REPL] The list of DARs passed to DAML REPL can now be empty.

changelog_end
2020-07-13 16:35:50 +00:00
Gary Verhaegen
6ea1afc247
run full compat tests on compat tests update PR (#6709)
This asks Azure to run a full compat test against the branch that
updates the compat test matrix, so we know it's good when we merge it
rather than the next morning.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-13 17:46:32 +02:00
Gary Verhaegen
61e9df3eaf
refactor ci jobs: add setvar to ci/lib.sh (#6708)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-13 17:34:54 +02:00
Moritz Kiefer
a0f9eae489
Respect project name in create-daml-app (#6694)
* Respect project name in create-daml-app

Now `daml new foobar create-daml-app` creates a project called
`foobar` replacing the name everywhere. The tests now run twice once
with the original project name since that’s what we use in the GSG and
once with a modified one. I guess you could argue that only running
the second should be enough so I’m open to removing the first one.

fixes #6681

changelog_begin

- [DAML Assistant] `daml new foobar create-daml-app` now properly
  respects the project name and creates a project called `foobar`
  instead of hardcoding the name fo `create-daml-app`.

changelog_end

* .

changelog_begin
changelog_end

* Remove debugging output

changelog_begin
changelog_end
2020-07-13 17:30:21 +02:00
Gary Verhaegen
6366fb753d
fix auto compat update PR (#6706)
This PR fixes a few things with the script that automatically updates
the compat test matrix on release, based on its use over the past two
weeks. Specifically:

- Send an error message to Slack in case this job fails. Previously,
  failures here were silent.
- Add an exponential backoff strategy to wait for the artifact to be
  available on Maven. Previously, the update script just failed.
- Allow for rerunning on the same machine after failure by removing the
  branch if it exists.
- Fix the commit message to include proper newlines instead of literal
  `\n`'s.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-13 15:52:50 +02:00
Moritz Kiefer
ce2a8a5086
Reduce dependencies of live-preview script (#6703)
The intention was to pull in the source for the GSG but it turns out
that the templates tarball doesn’t just bundle up files, it also
includes generated scala code for the scala quickstart which depends
on damlc. This PR splits the GSG sources including the patching into a
separate rule which does not depend on damlc and only copies that in
live-preview.

changelog_begin
changelog_end
2020-07-13 12:31:56 +00:00
Moritz Kiefer
7421db0afb
Improve documentation on fromSomeNote (#6702)
changelog_begin
changelog_end
2020-07-13 14:03:45 +02:00
Gerolf Seitz
4e987135a8
Sandbox, LedgerAPI Server: Allow specifying a metric prefix. (#6690)
[Sandbox][Ledger Integration Kit]: Metrics can now be exported to graphite with a prefix using the format ``--metrics-reporter=graphite://host:port/prefix``.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-13 12:48:40 +02:00
Moritz Kiefer
1db47df441
Bump migration timeout in compat tests (#6697)
With the increasing number of snapshots we sometimes hit the 300s timeout.

changelog_begin
changelog_end
2020-07-10 22:20:54 +02:00
Stephen Compall
dba6ac77b3
include contract keys in the Scala codegen output plan when using --root (#6696)
* include DefTemplate's key types under the Ty type variable

* note that contract key types are included by folding over DefTemplates' Tys

- the topo sort from --root now correctly includes contract keys

* test that contract key dependencies get included in the Scala codegen plan

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-10 15:26:51 -04:00
Miklos
1edc02a4f7
Populate deduplicateUntil in DamlOutOfTimeBoundsLogEntry by Committers (#6672)
* Removed unused code.

* Basic interface draft for producing pre-execution results.

* Share code for running all steps for a committer.

* Code tidying.

* Removed type parameter Submission from Committer.

* Simplify creation and using of committers.

* ExecuteSubmission => SubmissionExecutor

* Code tidying.

* Code tidying.
CHANGELOG_BEGIN
CHANGELOG_END

* Update ledger/participant-state/kvutils/src/main/scala/com/daml/ledger/participant/state/kvutils/committer/Committer.scala

Co-authored-by: Andreas Lochbihler <36634420+andreaslochbihler-da@users.noreply.github.com>

* Fixed build.

* Basic test cases for dryRun.

* Set to-be-notified participants to be everyone.

* Some tests for runSteps.

* Fixing merge.

* Organized imports.

* Added separate timer for pre-execution.

* Set min/max record time from context.

* preexecution => preExecution

* Code tidying.

* Code tidying.

* Set out-of-time-bounds log entry from context.

* Code tidying.

* Code tidying.

* Keep track of deduplication time window for transactions.

* Set deduplicateUntil in the generated log entry.

* Made min/max record time optional in pre-execution result.

Co-authored-by: Andreas Lochbihler <36634420+andreaslochbihler-da@users.noreply.github.com>
2020-07-10 17:50:02 +00:00
Miklos
f60ec5c2ed
[kvutils] Handle offsets in case of multiple updates from the same log entry (#6677) 2020-07-10 19:11:32 +02:00
Miklos
2e836dc6b3
Enable pre-executing submissions (#6592) 2020-07-10 19:03:20 +02:00
Andreas Herrmann
cddb5e30ab
Remove unused with-packages-wrapper (#6693)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-10 16:02:01 +00:00
Moritz Kiefer
631ed3e891
Bump timeouts in compat tests (#6689)
This bumps the timeout of the compat tests on PRs to 360 minutes
matching other jobs on a PR (we mainly hit this if ghc-lib is rebuilt)
and the timeout on the daily jobs to 720 minutes (we hit this if
_everything_ is rebuilt).

I am slightly worried about the timeout on the daily job. After having
taken a look at it, there are a few reasons how we ended up here:

1. We started including more tests, e.g., sandbox-classic. Not much we
   can do here, those tests are useful.

2. We have a very large number of snapshots for 1.3.0. There are a few
   reasons for this:

   1. Timing: We branched off early for the 1.2.0 release so the first
      snapshot for 1.3 was on June 3th. For 1.4 it looks like the first
      snapshot will be on July 15th so that’s roughly 2 extra
      snapshots just due to timing.

   2. Additional snapshots: We had one broken snapshot due to a broken
      VSCode extension that we didn’t delete (probably not worth doing
      at this point). We also had to backport to an old snapshot which
      resulted in another extra snapshot. We also had one extra
      snapshot which was supposed to be the RC but wasn’t since the
      ANF revert needed to go in.

   The only thing that is clearly useless is the one broken snapshot
   but that doesn’t change things that much. I see 2 orthogonal
   options for improving this assuming we agree that the current
   runtime is worryingly high.

   1. Prune snapshots more aggressively, e.g., only include the last 3
      snapshots. That’s a pretty arbitrary decision but it would
      enforce a hard limit.

   2. Reduce test combinations. E.g., only test snapshots vs stable
      releases but not snapshots vs snapshots.

3. We end up forcing a full build quite frequently. Here are just 2
   examples of how we’ve done that so far.

   1. Upgrade rules_haskell. Basically all tests are run by a Haskell
      binary so this forces a full rebuild.

   2. Change runfiles of `daml`.

I don’t think there is much we can do about 1 or 3 which leaves us
with 2. One not entirely unreasonable option is to just do nothing. We
did have periods where things went pretty smoothly for the most part
and each month we reset to a much smaller number of releases (we also
have to start throwing out old stable releases at some
point). Otherwise reducing the number of test combinations seems the
most promising option to me.

changelog_begin
changelog_end
2020-07-10 12:34:53 +00:00
Moritz Kiefer
7d466aa6a3
Fix fine-grained exclusions in ledger-api-test-tool (#6682)
* Fix fine-grained exclusions in ledger-api-test-tool

31995ee000 accidentally changed
`allTestCaseNames` to be a list of test suite names instead of a list
of test case names. That breaks fine-grained exclusions that we use in
our compatibility tests. I’ve also added a very basic test that both
the coarse-grained and fine-grained syntax is supported.

changelog_begin
changelog_end

* Update ledger/ledger-api-test-tool/BUILD.bazel

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-07-10 12:33:15 +02:00
Moritz Kiefer
abf957f806
Generate JS + typings to speed up dam2js (#6657)
* Generate JS + typings to speed up dam2js

This speeds up daml2js to the point where it’s basically instant on
the GSG (based on 3 runs before and after it’s somewhere between a
40-50x speedup).

Most of this is fairly straightforward. I looked at the generated code
from typescript and the docs for declaration files and adapted things.

There is one interesting point here:

We set the TypeScript configuration to commonjs + ES5. While ES6
modules work fine via `yarn start`, they unfortunately work less fine
in nodejs and in particular in jest. I spent some time trying to fix
it and in the end decided that this is not worth doing since all our
users have to do the same which sucks.

Therefore, the codegen also emits ES5 + commonjs so this is not a
breaking change.

The tests pass and I went through the GSG manually to check things
still work and also verified that types show up correctly in VSCode.

What I was sadly unable to do is to keep the ESLint test for the .d.ts
files. typescript-eslint really wants everything to belong to a
typescript project with a tsconfig.json which doesn’t make sense
here. I don’t think that’s a huge loss. We still have ESLint for the
JS files.

changelog_begin

- [daml2js] daml2js now generates JS + typescript declaration files
  directly instead of generating TypeScript code and invoking `yarn` to
  generate the JS + the declaration files. This does not require any
  changes to your code but it brings a significant speedup and removes the
  dependency on `yarn` for running `daml codegen js`.

changelog_end

* Update language-support/ts/codegen/src/TsCodeGenMain.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* Update language-support/ts/codegen/src/TsCodeGenMain.hs

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-07-09 20:07:03 +00:00
Rohan Jacob-Rao
98613d9671
Trigger service: doc explaining planned use of auth service (#6659)
* Add details about validity windows
* Reword description of auth service concepts
* Elaborate on auth flow dealing with token/credential expiry

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-09 14:27:50 -04:00
Moritz Kiefer
0fe4769b6b
Reduce the number of runfiles in the compatibility tests (#6670)
Details are in a comment.

changelog_begin
changelog_end
2020-07-09 17:15:16 +00:00
Stephen Compall
c2b36b5fe3
support Scala-typed exercise-by-key in Scala codegen (#6660)
* declare key type in Scala codegen output

* add `key` type and function to TemplateCompanion

* template key exercise* case

* test idiomatic ExerciseByKey creation

* add changelog

CHANGELOG_BEGIN
- [Scala Codegen] Support for creating exercise-by-key commands, using same
  exercise functions as exist for contract-IDs and the ``.createAnd`` pattern.
  See `issue #6466 <https://github.com/digital-asset/daml/pull/6466>`_.
CHANGELOG_END
2020-07-09 13:14:40 -04:00
Stefano Baghino
31995ee000
Ledger API Test Tool: deprecate unneeded tests and options (#6651)
* Ledger API Test Tool: deprecate unneeded tests and options

Furthermore, now all active tests are now run be default without needing
to specify --all-tests. The scheduler makes sure to run non-isolated
tests last (and sequentially).

Fixes #3747
Fixes #6518

A bit of historical context: tests in the Ledger API Test Tool used to
be the sandbox integration tests. As part of the Ledger API Test Tool
project, those tests have been ported one-to-one, with little review of
those same tests.

Examining the tests that cause #3747, it became evident that those tests
were originally put in place to verify that an isolated sandbox spun up
for a single test could withstand a number of commands slightly lower
than what at the time was the hard-coded back-pressure threshold. Hence,
implementing back-pressure on the Ledger API Test Tool would have
basically negated the usefulness of those tests. Furthermore, those
tests can be easily passed by simply raising the back-pressure
threshold. As such, they do not convey any meaningful information for
the DAML ledger implementor. This means we are retiring those tests. The
tests will be nominally kept in for a deprecation period to not break
existing build scripts, but running them explicitly will simply show
them as skipped. The documentation has been updated with the information
necessary to users to deal with retired tests.

Since all tests are now run by default --all-tests is being deprecated.
--load-scale-factor is also deprecated as it was used only by
TransactionScaleIT.

changelog_begin
[Ledger API Test Tool] The LotsOfPartiesIT and TransactionScaleIT test
suite have been deemed not providing relevant signal to DAML ledger
implementers and have been retired. The tests will be nominally kept in
but will be skipped while they are in a deprecation period. You are
advised to remove explicit references to those tests before they are
fully removed.
[Ledger API Test Tool] All tests are now run by default. The --all-tests
option is now ineffective and deprecated. You are advised to remove its
usages from your build scripts. Non-isolated tests that could affect the
global state of the ledger and interfere with other tests are now
automatically scheduled by the test tool to run sequentially at the end
of the run.
[Ledger API Test Tool] The --load-scale-factor option is now unused and
deprecated. You are advised to remove its usages from your build
scripts.
changelog_end

* Add test for deprecated CLI options

* Address https://github.com/digital-asset/daml/pull/6651#discussion_r452100158

* Address https://github.com/digital-asset/daml/pull/6651#discussion_r452126405

* Address https://github.com/digital-asset/daml/pull/6651#discussion_r452143811

* Address test failures
2020-07-09 14:01:32 +00:00
Stefano Baghino
cb18588cdf
Improve contribution guidelines (#6666)
* Improve contribution guidelines

Thanks @bame-da for the suggestions.

changelog_begin
changelog_end

What an ironically empty changelog entry list. :)

* Apply suggestions from code review

Thanks @SamirTalwar-DA, @cocreature and @garyverhaegen-da

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address review comments

- https://github.com/digital-asset/daml/pull/6666#discussion_r452094955
- https://github.com/digital-asset/daml/pull/6666#discussion_r452097001
- https://github.com/digital-asset/daml/pull/6666#discussion_r452096345

* Update CONTRIBUTING.md

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address https://github.com/digital-asset/daml/pull/6666#discussion_r452128400

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-07-09 13:32:10 +00:00
Moritz Kiefer
3b6f966e48
Set YARN_CACHE_FOLDER in all tests (#6669)
The default cache directories in yarn don’t work in the Bazel
sandbox. This results in Yarn creating tons of temp directories for
each test that are never cleared up.

This PR changes this to create actual temp directories that are
properly cleaned up.

changelog_begin
changelog_end
2020-07-09 13:11:07 +00:00
Miklos
4b94c27600
Generate out-of-time-bounds rejection log entries (#6630) 2020-07-09 14:28:44 +02:00
Remy
a3c35e9678
Engine: bug fix for transaction validation (#6664)
CHANGELOG_BEGIN
* [Engine] fix transaction validation bug
CHANGELOG_END
2020-07-09 13:43:22 +02:00
Andreas Herrmann
73c6fdffb8
Load multiple DARs into DAML REPL (#6656)
* REPL: Factor out Dar loading

* REPL accept multiple DARs

* REPL CLI take multiple packages

CHANGELOG_BEGIN
- [DAML REPL] The REPL now supports loading multiple DARs specified at
  the command line. The DARs are loaded as data-dependencies, and the
  modules of each DAR's main DALF will be imported into the REPL session
  at startup.
CHANGELOG_END

* REPL test loading multiple DARs

* REPL Load packages from current session

* REPL func-test test symbols from two DARs

* Update compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Repl.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-07-09 10:47:21 +00:00
azure-pipelines[bot]
fe869cc68a
update compat versions for 1.3.0-snapshot.20200708.4686.0.95dfa18e\n\nCHANGELOG_BEGIN\nCHANGELOG_END\n (#6655)
Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-07-09 09:56:34 +00:00
Rohan Jacob-Rao
30f1bf8d5a
Disable recovery test until I can fix the flakiness (#6654)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-08 11:17:12 -04:00
Moritz Kiefer
753221f475
Release yet another snapshot (#6652)
changelog_begin
changelog_end
2020-07-08 15:06:34 +00:00
Moritz Kiefer
95dfa18eb4
Fix leakage of SDK installations (#6648)
* Fix leakage of SDK installations

This fixes an issue where the integration tests leaked SDK
installations. Easily verified by `ls /tmp/extra-dir*` before and
after running the tests.

changelog_begin
changelog_end

* I hate windows so much

changelog_begin
changelog_end
2020-07-08 13:30:15 +00:00
Samir Talwar
b67e0eff76
sandbox: Accept a new time model when none is set. (#6646)
* sandbox: Move helpers in EmptyLedgerIT to a companion object.

* sandbox: Accept a new time model when none is set.

CHANGELOG_BEGIN
- [Ledger API Server + (Sandbox / Ledger Integration Kit)]
  Accept a new time model if none is set. Previously, it would
  erroneously be rejected because the generation number submitted to
  was incorrectly set to `2` rather than `1`.
  This would not affect most users of Sandbox or other kvutils-based
  ledgers, as if a configuration is set automatically on startup when
  creating a new ledger. It only affects users who explicitly override
  the initial ledger configuration submit delay to something longer than
  a few milliseconds.
CHANGELOG_END

* sandbox: Ensure that completions can be streamed from the beginning.

* sandbox: In EmptyLedgerIT, use the submission service.

* sandbox: Split EmptyLedgerIT into two.

* sandbox: In CompletionServiceWithEmptyLedgerIT, assume CI will be slow.

In other words, don't create a completion stream and expect a submission
to show up in a reasonable amount of time.
2020-07-08 13:27:02 +00:00
Moritz Kiefer
6c0bbd3ba6
Bump test_sha in perf tests (#6649)
This changed by the revert of the ANF changes which is harmless by the
same reasoning that made bumping it harmless when we introduced it.

changelog_begin
changelog_end
2020-07-08 12:26:11 +00:00
Moritz Kiefer
fbd24bd207
Lock down lodash version (#6650)
Crude hack but should hopefully unbreak CI for now.

changelog_begin
changelog_end
2020-07-08 12:02:24 +00:00
Samir Talwar
89369b3bb9
CI: Increase the PostgreSQL connections from 100 to 200. (#6647)
We saw a flake recently where PostgreSQL stopped accepting connections
during a CI run, leading the build to fail. This increases the number of
connections to 200 from the default of 100, hopefully mitigating issues
such as this one.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-08 10:49:11 +00:00
Moritz Kiefer
02c59d4f2a
Revert ANF changes and add a testcase for evaluation order (#6645)
* Revert ANF changes and add a testcase for evaluation order

After careful consideration, we decided that the change in evaluation
order that was accidentally introduced by the ANF changes should be
considered a breaking change or arguably even a bug and should not
land in 1.3.0.

Therefore, this PR reverts the following commits:

1. 353d0da6f7
2. a45b51042f
3. 04c7b2af7f
4. a624dd7242
5. b3aab72cee

Other PRs mostly had trivial merge conflicts that I resolved. The two
most interesting ones here are probably

1. https://github.com/digital-asset/daml/pull/6576 which was easy to
   resolve and the change to return SEValue instead of SExpr is still
   nice and useful even if we do not need the guarantees.
2. it https://github.com/digital-asset/daml/pull/6542 which required
   some changes since the constructors changed. If you want to review
   those changes in detail (they are pretty straightforward so not too
   important), it’s probably easiest to check out this PR and run
   ```
   git diff 2cd2a8f2a8
   daml-lf/interpreter/src/main/scala/com/digitalasset/daml/lf/speedy/Compiler.scala
   ```
   to see the diff to the parent commit of the first commit that
   introduced ANF.

changelog_begin
changelog_end
2020-07-08 12:40:12 +02:00
fabiotudone-da
9a135fa6f2
Revert unneeded kvutils format version bump (#6644)
* Revert unneeded kvutils format version bump

CHANGELOG_BEGIN
CHANGELOG_END

* Re-add change comment as part of the current (5) version.
2020-07-08 12:28:25 +02:00
Remy
e09755ca08
Replay transaction (#6464)
CHANGELOG_BEGIN
CHANGELOG_END
2020-07-08 10:21:48 +02:00
fabiotudone-da
474e92c13c
Track min and max record time in CommitContext when pre-executing (#6591) 2020-07-08 09:53:44 +02:00
Leonid Shlyapnikov
65087d9b9b
Stream pagination based on generated event sequence number (#6372)
* row_id changes

* fixing inserts

* replacing offset with row_id in the flat transaction stream queries

* fixing flat transaction query, updating H2 migration script

* fixing formatting

* ACS query pagination relies on row_id instead of ledger offset

* give a name to the index that we have to drop

* give a name to the index

* Fixing events range query it can return SQL nulls on empty DB.

* remove the debug println

* remove outdated comment

* removing unused orderByColumns constant

* getting rid of new `Source.flatMapConcat` calls that were added as part of this PR.

CHANGELOG_BEGIN

1. ACS, Flat Transaction and Transaction Tree stream pagination based on event_sequential_id instead of event_offset.
2. Events ordering based on the order of insertion: order by event_sequential_id instead of order by (event_offset, transaction_id, node_index).

CHANGELOG_END

* reverting changes to V13 H2 migration script,

figuring out the name of the index that has to be dropped

* Addressing code review comments:

- replacing scalaz Option.cata with stdlib Option.fold
- moving implicit val def into import

* Addressing code review comments:

- extracting re-usable stream query functions

* forcing postgres to use index when looking up lower and upper bound row ids

* fixing the query when it is run on an empty ledger

* resolving rebase conflicts

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/store/dao/events/EventsRange.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* fetching a single row, fetchSize should NOT matter

* Adding integration test to reproduce invalid order of archived, created events

The test fails, which is expected.

* Fixing the order of archived, created events triggered by exercise

* Addressing code review comments and cleaning up

* Renaming row_id to event_sequential_id

* Investigating flaky tests

* Fixing formatting

* Revert HOTFIX-flaky-client-server changes

`bazel test --runs_per_test=50 //ledger/participant-state/kvutils:reference-ledger-dump` passed on this branch.

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-07-07 19:53:18 -04:00
Moritz Kiefer
d768a6f5c7
Kill stale sandbox processes on macos and linux (#6642)
* Kill stale sandbox processes on macos and linux

changelog_begin
changelog_end

* Update build.sh

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* exitcodes are hard

changelog_begin
changelog_end

* Also kill stale sandboxes in compat tests

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-07-07 18:53:23 +00:00
Ognjen Maric
5a803c37d4
Return the ledger beginning as the ledger end on an empty ledger (#6638)
* Return the ledger beginning as the ledger end on an empty ledger

Previously, the services would return `Offset.beforeBegin` to the
clients, and the other services deem this offset to be invalid.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* Import DurationInt

* Kill unused import

* Use ApiOffset for the external ledger begin

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-07-07 17:12:03 +00:00
Stephen Compall
4cd419623a
replace traverseU and sequenceU with traverse and sequence (#6594)
* replace traverseU and sequenceU with traverse and sequence

- with -Ypartial-unification on, the extra Unapply typeclass lookup is
  unnecessary

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* limit imports; we only need *> and void
2020-07-07 15:01:58 +00:00
Moritz Kiefer
fcfe60e287
Include new snapshots in compat tests (#6635)
While we do have additional tests, they pass in a single-participant
setup even on older SDK so no new exclusions necessary.

Side note: The autoupdate PR for yesterday’s (second) snapshot failed
since Maven was too slow and the ledger-api-test-tool wasn’t there
yet. I would suggest that for now we wait and see if this happens
frequently (it definitely doesn’t happen always). If it does, we could
get the checksum from the current build and avoid the race.

changelog_begin
changelog_end
2020-07-07 12:11:57 +02:00
Andreas Herrmann
1bc119e99a
Update rules_haskell (#6600)
* Update rules_haskell

- Fixes the issue where a `sh_test` wrapping a `haskell_binary` couldn't
  add runfiles as is the case with other Bazel rules.

CHANGELOG_BEGIN
CHANGELOG_END

* Save the runfiles environment at start-up

To work around the fact that `withProgName` overwrites `argv[0]`.
See https://gitlab.haskell.org/ghc/ghc/-/issues/18418.

* damlc_compile_test include damlc runfiles

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-07 09:34:26 +00:00
Moritz Kiefer
75254eea3e
Add intermediate types to daml2js (#6615)
Previously, daml2js generated Text without any intermediate
representation. This both made the code pretty messy and it makes it
super hard to implement things like generating JS source + TS typings
instead of generating typescript.

This PR addresses this by first generating intermediate types which
are then rendered into Text in a separate step. This should hopefully
make it almost trivial to generate JS source + typings in the future
my implementing two rendering functions.

The types are somewhat adhoc atm. I expect that they will probably
change a bit anyway once we switch to JS + typings so I would like to
avoid bikeshedding the exact definitions too much.

I didn’t bother to preserve the pretty printing exactly as before. If
we really care about pretty output (why should we?), I would suggest
to switch to a proper pretty printing library (in a separate PR).

I apologize for the large PR. Not quite sure how to make it smaller.

changelog_begin
changelog_end
2020-07-07 10:18:15 +02:00
nickchapman-da
a45b51042f
Improve the interface to execute (pure) builtins. (#6613)
So that the resulting value is returned from the `execute` function, instead of being assigned to the `returnValue` machine state.

Rename the parent class from `SBuiltinMaybeHungry` to `SBuiltinEffect`, and have this be the parent of a few more subclasses which cannot meat the _pure_ interface.

Declare method `executeEffect` of the parent class `SBuiltinEffect` which has the same type as the original `execute`.

changelog_begin
changelog_end
2020-07-07 08:39:43 +01:00
Moritz Kiefer
bdf20befb1
Release 1.3.0 snapshot (#6623)
* Release 1.3.0 snapshot

This includes the fix for the indexer, a fix for the stackoverflow and
unpublishes daml-on-sql from GH releases.

changelog_begin
changelog_end

* Bump commit

changelog_begin
changelog_end
2020-07-06 17:57:11 +00:00