Commit Graph

7255 Commits

Author SHA1 Message Date
Sofia Faro
a6ee10be9a
Move visibility checks into speedy. (#10136)
* pass readAs to Engine.interpret/submit

* rename VisibleByKey -> Visibility

* Stop generating SResultNeedLocalKeyVisible

* engine: Remove localKeyVisible in Result.consume

* Don't run visibility checks during validation.

changelog_begin
changelog_end

* return of the scalafmt

* rename SVisibility -> SVisibleToStakeholders

* Extend documentation in engine for new argument

* sneaky error caused by merge
2021-06-29 11:36:55 +01:00
Samir Talwar
c764fbe573
contextualized-logging: Introduce different logging types for more structure. [KVL-996] (#10134)
* contextualized-logging: Automatically convert logging values to strings.

For now, this has almost the same behavior, but it allows us to
customize the output in the future.

The main change is that the log format has gone from:

    context: {a=b, x=1, foo=bar}

to:

    context: {a: "b", x: "1", foo: "bar"}

* contextualized-logging: Move `writeTo` inside `LoggingValue`.

* contextualized-logging: Allow for more than just strings.

`null`, numbers, and sequences are now correctly logged.

The log format has gone from:

    context: {a: "b", x: "1", foo: "bar", parties: "[alice, bob]"}

to:

    context: {a: "b", x: 1, foo: "bar", parties: ["alice", "bob"]}

CHANGELOG_BEGIN
- The log output of Daml components has changed so that the structured
  part is closer to JSON. This allows us to distinguish and parse
  numbers and lists. If you are parsing this log output, you may need to
  change your parser.

  The log output has changed from:

  .. code-block::

     context: {a=b, x=1, foo=bar, parties=[alice, bob]}

  to:

  .. code-block::

     context: {a: "b", x: 1, foo: "bar", parties: ["alice", "bob"]}

CHANGELOG_END

* contextualized-logging: Extract the string serializer.

* Use non-string logging where possible.

* contextualized-logging: Split logging values from serialization.

So that callers don't have to know about Jackson.

* contextualized-logging: `SeqView` is `Iterable`. Don't need both.

* contextualized-logging: Make `ToStringToLoggingValue` a `val`.

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* contextualized-logging: Add a transient dependency for 2.12 only.

This required more infrastructure than I thought it would.

* kvutils: Make it explicit that we're logging the hashes of archives.

The implicit was found to be a little confusing.

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2021-06-29 09:16:26 +00:00
Brian Healey
678cab0327
10050 append only schema on oracle (#10051)
* Oracle compliant append only schema

CHANGELOG_BEGIN
CHANGELOG_END

WIP : oracle on new appendonly schema

* diff to postgres dump, create consolidated view

* diff to postgres dump to ensure all oracle setup is equiv

* recompute sha for changed oracle flyway scripts

* drop old tables to prevent clash on name of new participant_events view

* recompute sha for flyway script

* prelim oracle StorageBackend

* Adds support for special preparedStatement for oracle

* Add support and wires to setObject by default everywhere
* Add the full OracleField suite with TODOs for convenience
* Wires OracleField suite to OracleFieldStrategy

changelog_begin
changelog_end

* enable debug version of oracle driver

* conversion Instant -> Timestamp for oracle

* WIP: primitive println debugging

* Passing PackagesSpec with appendonlyschema on Oracle
Rename size column to siz to avoid reserved word clash, including migration script for postgres

* include sha for new postgres migration script

* add missing copyright header

* cleanup

* passing party spec for appendonly on oracle

* passing configuration spec for appendonly on oracle

* scalafmt

* bazel buildifier reformat

* use db generic FETCH NEXT n ROW ONLY rather than limit for cross db compat

* siz instead of size for packages table on all dbs and schema

* revert enabling oracle jdbc debug

* Support Array[String] -> String conversion (and vice versa) for JSON array
Remove as aliases for tables as this does not work with oracle
Extract submitters clause for all db types
Use append transaction injector for oracle append only spec

* scalafmt

* correct oracle failing active contract spec tests

* wire in JdbcLedgerDaoCompletionsSpec

* remove semi-colons for ending statements that are problematic for oracle driver

* all tests up to divulgence passing for append only on oracle

* all appendonly tests passing on oracle

* remove ignore on fall back to limit-based query with consistent results

* do not change name of size column in packages table for mutable schema for all DBs

* do not change name of size column in packages table for mutable schema for all DBs

* standalone oracle appendonly schema script
regen shas on flyway scripts
revert some cosmetic refactoring in CommonStorageBackend

* Fixes conversion to parties from Oracle-JSON at flatEventWitnessesColumn

* Switches from composit SQLs to single SQLs at prepared statements to accommodate Oracle limitation

* Fixes arrayIntersectionWhereClause by applying patch from mutable Oracle schema integration

* Fixes queries with empty startExclusive Offsets

* First draw adding Oracle conformance test suites to CI

* wire in the oracle conformance tests for CI

* Use cross-db fetch next $n rows only syntax instead of limit syntax that works only for postgres/h2

* rename siz to package_size

* recompute shas

* scalafmt and include sha check for oracle append only flyway script

* correct missing package_size rename

* remove some todos -- correct corrupted V1__Init.sql

* Update ledger/ledger-on-sql/src/test/lib/scala/com/daml/ledger/on/sql/MainWithEphemeralOracleUser.scala

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>

* correct version number for postgres rename column scripts

* remove unnecessary migration tables for oracle append only

* review feedback: rename createEventFilter as requested, remove todos

* review feedback: case consistency

* review feedback: update todos with issue markers

* review feedback: cleanup

* review feedback: OracleField and OracleSchema cleanup

* Fixing Table generators to use preparedData for convenience

* Placing TODOs for refactorings later

* Renames initial append-only oracle script, for convenience

* Falls back to original behavior as far prepared statements go at couple of queries

Co-authored-by: Marton Nagy <marton.nagy@digitalasset.com>
Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2021-06-28 18:51:48 -04:00
Stephen Compall
f5e5062470
ensure that signatories and observers are disjoint in ledger-api CreatedEvents (#10123)
* document that signatories shouldn't appear in observers in ledger-api

CHANGELOG_BEGIN
CHANGELOG_END

* add disjoint signatories/observers checks to ACS and transaction ledger-api tests

* scala 2.12 compatibility

* "never" replaces "should not"

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

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-28 20:28:31 +00:00
mziolekda
ffc88d52b4
print version of the ledger api test tool as part of the report (#10119)
* print version of the ledger api test tool as part of the report
CHANGELOG_BEGIN
CHANGELOG_END

* correct bazel file
2021-06-28 17:35:32 +02:00
mziolekda
621cfa4a91
Resolve contract keys conflicts in disclosed contracts (#9948) (#10034)
* Resolve contract keys conflicts in disclosed contracts (#9948)

* build queries for nullifications of past key

* format code

CHANGELOG_BEGIN
In case a contract key is already present in a past contract in the contract table nullify it. This gets rid of contract keys of previously disclosed contracts. We never discover that disclosed contracts get archived, so we get conflicts on such past keys
CHANGELOG_END

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

* correct oracle implemantation (new)

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-28 17:04:18 +02:00
Stefano Baghino
f1ffd52e08
Java bindings: add DamlRecord, deprecate Record (#10132)
* Java bindings: add DamlRecord, deprecate Record

Fixes #10130

changelog_begin
[Java bindings] In order to avoid clashing with `java.lang.Record` (introduced
in Java 14), `com.daml.ledger.javaapi.data.Record` has been renamed to
`com.daml.ledger.javaapi.data.DamlRecord`. The old name has been used to
denote a sub-type of the newly renamed one, so it can still be used, but it has
been marked as deprecated.
[Java codegen] The Java codegen now uses the `DamlRecord` type wherever `Record`
was used before.
changelog_end

Boy-scout rule:
- removed references to ~old~ ancient versioning
- used `@deprecated` Javadoc annotation wherever meaningful
- some import re-arrangement performed by the linter

* Address https://github.com/digital-asset/daml/pull/10132#discussion_r659705929
2021-06-28 12:08:51 +00:00
Remy
3df2566305
Scenario: move Scenario Error Throwable to scenario package (#10075)
com.daml.lf.speedy.SErrorScenario => com.daml.lf.scenario.Error

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-28 12:04:57 +00:00
Victor Peter Rouven Müller
7521ec9988
[JSON-API] Include contract id in the logging ctx when logging exercise commands (#10131)
changelog_begin

- [JSON-API] The contract id is now also included in the logging ctx when logging exercise commands

changelog_end
2021-06-28 09:12:40 +00:00
azure-pipelines[bot]
e0e333377c
update NOTICES file (#10129)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-06-28 06:38:35 +00:00
Remy
398300b76f
LF: Move Speedy Interpretation Error to transaction package (#10091)
to be accessible from any package

part of #9974

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-25 20:50:15 +02:00
Moritz Kiefer
d4150ac078
Refactor error reporting in Daml Repl (#10118)
* Refactor error reporting in Daml Repl

fixes #10098

As mentioned in that issue, the current behavior is a mess which
silently drops errors in certain cases. This PR switches things around
so that errors are reported to the client and we print them there
making sure that no error should ever get lost.

changelog_begin
changelog_end

* Bump timeout

changelog_begin
changelog_end
2021-06-25 14:08:44 +00:00
azure-pipelines[bot]
0108fedd4e
update NOTICES file (#10112)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-06-25 13:57:16 +02:00
nickchapman-da
6af36fe1e3
Fix Tx.Metadata for normalized transactions (#10108)
* fix Tx.Metadata for normalized transactions

changelog_begin
changelog_end

* Fixup action seed normalization

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-06-25 10:53:11 +02:00
Robert Autenrieth
7745693648
Remove duplicate index (#10084)
changelog_begin
changelog_end
2021-06-25 10:32:08 +02:00
Robert Autenrieth
1b617ae22d
DPP-428 Add missing indices for index initialization (#10083)
* Add missing indices for index initialization

changelog_begin
changelog_end

* Do not create unnecessary indices

* Create indices in H2

* Fix Oracle migration hash

* Verify all migration hashes
2021-06-25 10:31:58 +02:00
Samir Talwar
af9382ce92
contextualized-logging: Reduce the API surface and avoid name collisions. (#10102)
* contextualized-logging: Remove `Map` from the `LoggingContextOf` API.

* contextualized-logging: Encapsulate entries.

CHANGELOG_BEGIN
CHANGELOG_END

* contextualized-logging: Disambiguate `withEnrichedLoggingContext`.

So forthcoming implicit conversions won't confuse the compiler.

* contextualized-logging: Remove a now-unused compat import.

* contextualized-logging: Avoid overloading `LoggingEntries#apply`.

* contextualized-logging: Remove the silencer plugin.
2021-06-24 16:21:26 +00:00
Stephen Compall
01d6770450
json-api perf tests: combine large-ACS frequencies combinatorially instead of in lockstep (#10101)
In #10016, 1% template ID and 1% party-set membership meant _the same_ 1%,
meaning that an index of both couldn't possibly yield interesting results.  This
changes how LargeAcs builds the large ACS so that it's "1% of 1%", as you'd
expect.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 10:00:02 -04:00
Moritz Kiefer
a44afcff42
Upgrade nixpkgs (#9908)
* Upgrade nixpkgs

changelog_begin
changelog_end

* Upgrade Bazel on Windows

changelog_begin
changelog_end

* bump bazel hash

changelog_begin
changelog_end
2021-06-24 13:58:56 +00:00
Victor Peter Rouven Müller
9498d1509b
[DOCS] Let jwt.io link to an already filled in working payload (#10026)
changelog_begin
changelog_end
2021-06-24 14:35:33 +02:00
Moritz Kiefer
4affb053e9
Force newer version of glob-parent in Navigator (#10105)
This addresses a dependabot alert.

No nice way to do this unfortunately, it’s pulled in via transitive
deps which don’t have a version with less restrictive bounds.

I did test manually that Navigator still works (it’s a dev-time only
dependency).

changelog_begin
changelog_end
2021-06-24 14:04:38 +02:00
Remy
f745f10394
LF: Realease LF 1.14 (#10077)
CHANGELOG_BEGIN
- [LF] Add support for Excepction
CHANGELOG_END
2021-06-24 13:44:09 +02:00
Marton Nagy
05056ddd8c
Cut a flaky expectation some more slack (#10106)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 11:35:41 +00:00
Moritz Kiefer
46a66e2f2a
Upgrade jest to the latest version (#10107)
This ends up transitively bumping yargs-parser which has a
vulnerability but more generally I also just like being on the latest version.

changelog_begin
changelog_end
2021-06-24 11:16:29 +00:00
azure-pipelines[bot]
84e329885f
update compat versions for 1.11.2 (#10104)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-06-24 13:07:03 +02:00
Remy
a6b536f3c4
Compiler: Make LF 1.13 the default output (#9907)
* Compiler: Roll LF Version

Fix #8591

CHANGELOG_BEGIN
- [Compiler] Default ouput LF version is now 1.13
CHANGELOG_END
2021-06-24 11:58:50 +02:00
mziolekda
29ddc88dcb
remove redundant spaces in the log format (#10093)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-24 07:36:03 +00:00
Robert Autenrieth
01e329f2de
DPP-432 Add exception tests to the JdbcLedgerDao suite (#10040)
* Add exception tests

changelog_begin
changelog_end

* Add another test

This one tests a transaction that can only be
produced by a privacy-aware ledger.

* Address review comments
2021-06-23 23:20:18 +02:00
Moritz Kiefer
3d79cbf2b1
Bump compat versions (#10096)
We need to do the same override for the gRPC version we do on main to
resolve conflicts.

changelog_begin
changelog_end
2021-06-23 22:12:04 +02:00
Moritz Kiefer
5bf7d8f570
Fix speedy perf reporting (#10100)
jq does not like dashes see https://github.com/stedolan/jq/issues/38

changelog_begin
changelog_end
2021-06-23 20:16:47 +02:00
Moritz Kiefer
0970821ce7
Bump cpu alloc for build-and-lint (#10099)
changelog_begin
changelog_end
2021-06-23 17:57:41 +00:00
tudor-da
cbca779657
[In-memory fan-out] Ensure getTransactionLogUpdates with max fetch size (#10064)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-23 16:32:58 +00:00
Kamil Bożek
c756153951
Release SDK 1.11.2 (#10094)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-23 18:26:47 +02:00
azure-pipelines[bot]
3a4235400d
rotate release duty after 1.15.0-snapshot.20210622.7213.0.d867d904 (#10086)
@S11001001 is taking care of 1.15.0-snapshot.20210622.7213.0.d867d904 (#10085), so they get pushed back to the end of the line.

Please do not merge this before #10085.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-06-23 10:29:16 -04:00
Stephen Compall
ecc2d11536
recommend some daml compiler warnings to enable (#10082)
- based upon @cocreature's
  https://discuss.daml.com/t/making-the-most-out-of-daml-compiler-warnings/739

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-23 14:20:59 +00:00
Moritz Kiefer
b2bb45e4d9
Bump daml repl timeout (#10089)
changelog_begin
changelog_end
2021-06-23 14:19:26 +00:00
mziolekda
db60d15b5e
Log ledger api validation failures at info level (#10080)
* CHANGELOG_BEGIN
Log ledger api validation failures at info level
CHANGELOG_END

* log validation failures in Api*Service family of classes

* address review comments
2021-06-23 13:31:48 +00:00
Moritz Kiefer
f0dc025ac9
Release 1.15 snapshot (#10090)
changelog_begin
changelog_end
2021-06-23 14:31:29 +02:00
nickchapman-da
5b73813dfd
Support reinterpretation for failing commands (#9993)
* WIP: reinterpret must fail

changelog_begin
changelog_end

EXPLORE: add x/y prefix to reinterpret

MiniEngineTest.scala

MiniTests.daml

setup reinterpret testing one step down, to be able to see rollback nodes

MiniEngineTest.scala - refactor yreinterpret

first minimal reinterpret test

setup testcase for reinterpret on a command which throws

catch exception during reinterpret; and test

introduce type for Validating; avoid boolean blindness

remove exploratory MiniTests

remove exploratory x/y prefix on reinterpret

question

fix build

* small cleanup

* add `unsafeCompileForReinterpretation`; preserve interface of existing `unsafeCompile` (command list)

* remove the Validating type (not needed for this work)

* undo format change

* more private

* update comment for Engine.reinterpret

* test ensure failure works correctly; no rollback expected

* refactor to share duplicated code in reinterpret tests

* remove unhelpful create/ensure tests

* test that reinterpretation of an uncatchable error remains a failure

* test that rollback-version-check-error remains a failure for reinterpretation

* remove dev comment left in by accident
2021-06-23 10:39:10 +00:00
Samir Talwar
e32856ecf4
dev-env: Use nix-shell for scripts instead of sourcing dade-common. (#10088)
* Introduce shell.nix to expose the Nix tooling, if required.

* dev-env: Rewrite the ghcide script to use nix-shell.

* language-support/hs: Use `nix-shell` for export-package.sh.

* Nix: Add a shebang to the Bazel wrapper script.

CHANGELOG_BEGIN
CHANGELOG_END

* dev-env: Standardize the `set` header in `ghcide`.
2021-06-23 09:39:00 +00:00
Samir Talwar
682c096d4f
dev-env: Remove some unused stuff. (#10087)
* dev-env: Replace `gpg` and `make` with symlinks.

* dev-env: Remove sphinx-autobuild. It's brought in by pipenv.

* dev-env: Remove Python 3.6 references. They seem to be unused.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-23 08:13:38 +00:00
Moritz Kiefer
85e383ce0b
Fix --max-inbound-message-size flag in Daml Repl (#10078)
fixes #10072

changelog_begin
changelog_end
2021-06-23 10:10:40 +02:00
Stephen Compall
d867d90400
define query offset semantics solely in terms of #9847 per-query offsets (#10071)
Since per-request offset can be described strictly as a special case of the new
per-query offset semantics, go ahead and describe it that way, so that really
only one model needs to be understood to fully comprehend the query request
semantics.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-22 12:32:48 -04:00
Victor Peter Rouven Müller
1f5aa4491c
[JSON-API] Add metrics for ledger command submission timing (#10076)
changelog_begin

- [JSON-API] Timing metrics which measure how long the processing of a command submission request takes on the ledger are now available

changelog_end
2021-06-22 15:59:23 +00:00
azure-pipelines[bot]
7eb2ce72a9
update compat versions for 1.15.0-snapshot.20210615.7169.0.adeba206 (#10028)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2021-06-22 17:44:18 +02:00
Moritz Kiefer
c44f33736e
Simplify speedy benchmark (#10079)
This PR drops two things:

1. The check that the benchmark hasn’t been modified. This hasn’t ever
been useful and it keeps being annoying.
2. It stops the comparison against the old version and instead just
benchmarks the current version. We really only care about the day to
day changes. Comparing against an arbitrary year old version has lost
all meaning at this point.

changelog_begin
changelog_end
2021-06-22 15:11:47 +00:00
Remy
58b1c4e771
Speedy: Refactor contract Id/Key callback (#10033)
CHANGELOG_BEGIN
CHANGELOG_END
2021-06-22 16:34:28 +02:00
Oliver Seeliger
8558c73f27
Upgrade canton to 0.25.0 based on daml 1.14.0 (#10074)
changelog_begin
changelog_end
2021-06-22 12:18:28 +00:00
Moritz Kiefer
e4c1c58317
Run scenarios in off-ledger machine (#10070)
* Run scenarios in off-ledger machine

This PR builds on the previous PR that split scenario execution in two
different speedy machines and now actually makes the machine that runs
scenarios run in off-ledger mode just like we handle Daml Script.

This required a bunch of refactoring to make it nice so apologies for
the slightly large PR. Hopefully it’s still relatively easy to follow
and luckily it deletes more code than it adds.

changelog_begin
changelog_end

* Apply suggestions from code review

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

* review comments

changelog_begin
changelog_end

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2021-06-22 12:11:00 +02:00
Gary Verhaegen
31a76a4a2a
allow CI pools to use any zone (#10069)
This morning we started with very restricted CI pools (2/6 for Windows
and 7/20 for Linux), apparently because the region we run in (us-east1)
has three zones, two of them were unable to allocate new nodes, and the
default policy is to distribute nodes evenly between zones.

I've manually changed the distribution policy. Unfortunately this option
is not yet available in our version of the GCP Terraform plugin.

CHANGELOG_BEGIN
CHANGELOG_END
2021-06-22 10:43:08 +02:00