Commit Graph

10923 Commits

Author SHA1 Message Date
nickchapman-da
ef959deeac
[engine] improve stacktrace for daml-script InterpretationError (#15178)
* improve stacktrace for daml-script InterpretationError

changelog_begin
changelog_end

* adapt expected regexp
2022-10-06 15:54:50 +00:00
atriantafyllos-da
fd38b652ec
Update caffeine to 3.0.5. (#15176)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-06 17:12:39 +02:00
Stephen Compall
10b5654aab
more Javadocs for codegen base library (#15171)
* javadoc DefinedDataType tree
* javadoc ContractWithKey
* javadoc ValueDecoder

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-06 14:33:34 +00:00
Stefano Baghino
32a6896ca7
Add link to support page (and indirectly to the support portal) (#15167)
* Add link to support page (and indirectly to the support portal)

changelog_begin
changelog_end

* Update docs/source/support/support.rst

Co-authored-by: carrielaben-da <91496516+carrielaben-da@users.noreply.github.com>

Co-authored-by: carrielaben-da <91496516+carrielaben-da@users.noreply.github.com>
2022-10-06 10:03:10 +00:00
Moisés Ackerman
ccb7ef7167
Add HasField instances for DA.Stack.SrcLoc (#15163)
* Add HasField instances for DA.Stack.SrcLoc (#15142)

changelog_begin
[DA.Stack] The SrcLoc datatype now supports dot syntax for field access (#15142)
changelog_end

* Add daml-test-file SrcLocFields to test dot syntax on DA.Stack.SrcLoc

* Define 'HasField f SrcLoc t' instances using record syntax
2022-10-06 11:53:22 +02:00
azure-pipelines[bot]
4700cf9e99
bump canton to 20221005 (#15174)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-06 10:52:25 +02:00
Sergey Kisel
de7a946d2e
Additional security tests for Ledger API [DPP-1256] (#15166)
* Additional security tests for Ledger API [DPP-1256]

CHANGELOG_BEGIN
CHANGELOG_END

* Additional security tests for Ledger API [DPP-1256]

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-06 10:37:58 +02:00
Marton Nagy
0f5c3c3305
Contract Store Refactoring (#15075)
* Segregates ContractStore (pulls out MaximumLedgerTimeService)
* Renames lookupContractForValidation to lookupContractStateWithoutDivulgence, and adds the contractInstance to the results
* Adds implementation for MaximumLedgerTime computation depending on lookupContractStateWithoutDivulgence
* Adds unit tests for the implementation
* Adapts/fixes other tests
* Removes original MaximumLedgerTime implementation from MutableCacheBackedContractStore

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-05 19:05:59 +00:00
atriantafyllos-da
b3a44cb3ee
Removed MeteredLedgerDao [DPP-1242]. (#15148)
CHANGELOG_BEGIN
The following metrics were removed:
  - daml.index.db.store_party_entry
  - daml.index.db.store_package_entry
  - daml.index.db.store_ledger_entry_combined
  - daml.index.db.store_rejection
  - daml.index.db.store_configuration_entry
  - daml.index.db.lookup_ledger_id
  - daml.index.db.lookup_participant_id
  - daml.index.db.lookup_ledger_end
  - daml.index.db.lookup_ledger_configuration
  - daml.index.db.get_parties
  - daml.index.db.list_known_parties
  - daml.index.db.list_lf_packages
  - daml.index.db.get_lf_archive
  - daml.index.db.prune
CHANGELOG_END
2022-10-05 15:47:32 +02:00
Gerolf Seitz
ed00c0d3aa
Add @gerolf-da to release rotation (#15168)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-05 14:20:19 +02:00
azure-pipelines[bot]
6a46deafe5
bump canton to 20221004 (#15165)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-05 11:44:10 +02:00
Sergey Kisel
759ce0b8e0
Additional security tests for Ledger API [DPP-1256] (#15161)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-05 08:47:18 +02:00
Stephen Compall
6df0c24d78
turn on -Xlint -Werror for Java bindings (#15155)
* turn on -Xlint -Werror for Java bindings
* remove unused locals
* remove raw casts for deprecated Record
* fix rawtypes
* don't check for serialVersionUID
* some javadoc for DefinedDataType
* add lint to bindings-rxjava; deprecate ledger identity client
* document DamlRecord
* fix rawtypes in Java codegen output
* fix unused cast in Java codegen output
* enable -Xlint for Java codegen output

CHANGELOG_BEGIN
- [Java codegen] Now outputs code that should pass ``-Xlint:rawtypes``
  as well as other ``-Xlint`` warnings.
CHANGELOG_END
2022-10-04 10:57:45 -04:00
Stephen Compall
f2f311a7da
mark internal Java bindings functions in Javadoc (#15151)
* note that makeExerciseCmd is not for application use
* notes on Contract, *Companion
* doc View type parameter
* fromContractId is also internal API

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-04 07:59:29 -04:00
Moisés Ackerman
b26eab3d6c
Handle sums-of-products correctly in daml ledger export (#15152)
* Extract encodeVariant

* Add special case for encoding record members of variants

* Test special case for encoding record members of variants

* Test variant records in 'daml ledger export' golden test 'export-values'

* Update TODOs

* Add comments for untested cases in export-values golden test

changelog_begin
- [Daml export] Fixed an issue with the handling of sums-of-products (#14723)
changelog_end
2022-10-04 13:49:05 +02:00
tudor-da
ae037ab5fd
Fail Akka sources with distinct throwables [DPP-1241] (#15084)
* On Dispatcher cancel, fail sources with distinct throwables

changelog_begin
Fixes an issue where failing multiple sources with the same StatusRuntimException
leads to an unhandled error in the gRPC serialization layer. This issue was
caused by serialization actually mutating the non-thread-safe io.grpc.Metadata
contained in the StatusRuntimeException.
changelog_end

* Fix ApiVersionService internalError

* Log error on ServerCall.close() errors

* Address Sergey's review comments

* Addressed more review comments

* Accessor method for call.close to bypass IllegalAccessErrors

* Use unique kill switches per stream in generated Akka Grpc streaming services

This change has two benefits:
- The error is logged only on an actual stream termination
- The throwable is not shared between streams, avoiding concurrent Metadata access errors

* Addressed Marton's review comments
2022-10-04 11:39:38 +00:00
azure-pipelines[bot]
0e7ff2b025
update NOTICES file (#15157)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-04 11:31:21 +02:00
azure-pipelines[bot]
fd00914e04
bump canton to 20221003 (#15156)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-04 06:52:58 +00:00
pbatko-da
a55ccc384e
[DPP-1219] Move local stores for participant users and parties to a separate bazel target (#15108)
changelog_begin
changelog_end
2022-10-03 17:26:28 +02:00
Moisés Ackerman
b30e0a3844
Add non-docs golden test for daml ledger export (#15136)
* Extract example-export-client to //daml-script/export/integration-tests/example-export-client

changelog_begin
changelog_end

* Parametrize example-export-client with Daml script to export

* Parametrize example-export-client with parties

* Extract daml_ledger_export_test to daml-script/export/integration-tests/matches-docs/util.bzl

* Rename daml-script/export/integration-tests/{matches-docs=>golden}

* Rename //daml-script/export/integration-tests/golden:{example-export=>matches-docs}*

* rules_daml/daml.bzl:daml_compile now accepts dependencies

* Drop trailing whitespace in daml ledger export comment

* Add test //daml-script/export/integration-tests/golden:export-values-compare
2022-10-03 15:31:51 +02:00
Moisés Ackerman
ca57d90fde
Mention interface instances in 'Reference: Templates' docs (#15133)
* Rename {My=>NameOf}Template in Interface docs code snippets

* Mention interface instances in 'Reference: Templates' docs

changelog_begin
changelog_end

* Remove 'active development' warning for interfaces

The warning for _required_ interfaces stays
2022-10-03 13:03:58 +00:00
atriantafyllos-da
507f18ad20
Dpp 1222 move metric tagging classes to daml sdk (#15067)
Moved canton's tagging metric class [DPP-1222].

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-03 14:23:07 +02:00
azure-pipelines[bot]
6340de5344
update compat versions (2022-10-01) (#15145)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-03 12:06:58 +02:00
Chun Lok Ling
1adf3930cd
passed value decoder to interface Companion (#15143)
* passed value decoder to interface Companion

CHANGELOG_BEGIN
CHANGELOG_END

* throw IllegalArgumentException if view type not found for an interface

CHANGELOG_BEGIN
CHANGELOG_END

* address comments

* test

* test

Co-authored-by: Chun Lok Ling <lokling@gmail.com>
2022-10-03 10:03:07 +01:00
Sergey Kisel
7787f5e1fe
InterfaceSubscriptionsIT Test for include_create_arguments_blob (#15107)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-03 10:06:47 +02:00
azure-pipelines[bot]
6ba5549bb7
bump canton to 20220930 (#15144)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-03 08:49:11 +02:00
Remy
604e89cc77
Enable DeeplyNestedValueIT for canton (#15140)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-03 08:19:14 +02:00
mziolekda
10f874f465
Make test tool adopt to the level of user-management support [DPP-1250] (#15135)
* Make test tool adopt to the stage of user-management support

CHANGELOG_BEGIN
CHANGELOG_END

* Fix broken test

* Fix post review
2022-09-30 15:45:11 +02:00
tudor-da
0f59026a67
[ED] Clean-up [DPP-1210] (#15127)
* [ED Clean-up] Extract validateTimestamp to FieldValidations and improve error messages

changelog_begin
changelog_end

* Permanently enable ExplicitDisclosureIT:EDMetadata

* Cleanup ExplicitDisclosureIT
2022-09-30 14:34:59 +02:00
Carl Pulley
6364deb68e
Disable visibility checks for disclosed contracts and disclosed contract keys
* Fixes #14168

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-30 09:38:08 +01:00
azure-pipelines[bot]
319afd82d4
bump canton to 20220929 (#15138)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-09-30 09:00:55 +02:00
Stephen Compall
a55eabb132
handle incomplete event metadata for parsing exercise results (#15050)
* drop payload and key instead of passing through
* build a "hidden" dar with a new template for build-and-lint-test
* test the events that come back; passing
* test key and that template is definitely not registered
* confirm test fails without changes to @daml/ledger

  ✕ undecodable exercise result event data is discarded (334 ms)

● interfaces › undecodable exercise result event data is discarded

  Failed to look up template 24124e8b5ae6c7f06835529d5b7338ed32308cdcb6409ba72f88351da9145ff1:Hidden:NotVisibleInTs. Make sure your @daml/types version agrees with the used Daml SDK version.

    at lookupTemplate (../../../../language-support/ts/daml-types/index.ts:269:11)
    at ../../../../language-support/ts/daml-ledger/index.ts:196:59
    at ../node_modules/@mojotech/json-type-validation/src/decoder.ts:795:31
    at Result.andThen (../node_modules/@mojotech/json-type-validation/src/result.ts:130:19)
    at Decoder.decode (../node_modules/@mojotech/json-type-validation/src/decoder.ts:795:7)
    at Decoder.decode (../node_modules/@mojotech/json-type-validation/src/decoder.ts:312:37)
    at Decoder.decode (../node_modules/@mojotech/json-type-validation/src/decoder.ts:501:31)
    at decodeValue_1 (../node_modules/@mojotech/json-type-validation/src/decoder.ts:371:68)
    at ../node_modules/@mojotech/json-type-validation/src/decoder.ts:375:65
        at Array.reduce (<anonymous>)

CHANGELOG_BEGIN
- [JS codegen] Exercise no longer fails on unrecognized templates occurring in
  create/archive events resulting from an exercise, such as may happen when
  exercising interface choices; instead, any such "uninterpretable creates" have
  their payloads changed to ``{}`` and their keys removed.
CHANGELOG_END
2022-09-29 17:12:51 +00:00
Carl Pulley
233bca9d01
Proper error handling on input validation of disclosed contracts
* Fixes #14200

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-29 17:21:02 +01:00
Simon Maxen
817e6aac01
Exclude infrastructure transactions [DPP-1110] (#15121)
* Exclude infrastructure transactions

changelog_begin
changelog_end
2022-09-29 16:22:52 +01:00
Simon Maxen
0654f9978c
Add libs-scala/struct-json (#15090)
changelog_begin
changelog_end
2022-09-29 16:22:01 +01:00
Chun Lok Ling
40e994bd46
Bug fix. template id of archived contracted should be interface id instead (#15117)
* use Consume.syntax

* added exercise in interface "sub query endpoint" test case. checked template id of archive. it is asserting to be template id but not interface id which is wrong. I will change it back to interface id after all CI passed

* test that the archive events have the interface ID; add the template-ID-to-interface-ID mapping to archive events in websocket result stream

* Add change log

CHANGELOG_BEGIM
CHANGELOG_END

* Add change log

CHANGELOG_BEGIN
CHANGELOG_END

* use JSON converter instead of hand-writing JSON

* factor assertions for created records

* combine value assertions

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-09-29 11:52:19 +01:00
dylant-da
485eb2b8dd
Archive choices for interfaces (#15085)
* Point to latest GHC with archive choices on interfaces

* Update Desugared daml for interfaces Archives

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-doc test files

* Add relevant identifiers to SignatureReaderSpec for iface Archive choice

* lint

* Point to GHC with generated HasArchive instance

* Add test for archive on interface

* Test that second archive doesn't work

* Update desugar tests

* Point to GHC merge
2022-09-29 10:57:07 +01:00
Chun Lok Ling
28f37cb003
ValueDecoder Interface (#15017)
* FromValue Interface

* add deprecated and new fromvalue method

* debug log

* added apply

* no semicolon

* colon

* fix VariantConstructorClass

* fix VariantConstructorClass

* fix VariantConstructorClass

* fix VariantConstructorClass

* fix test cases

* add changelog

CHANGELOG_BEGIN
CHANGELOG_END

* For template, use the fromValue in contract companion

* Added private value decoder method for passing in to contract companion

* WIP

* move variant sub type decoder method to the base variant class

* remove debug log

* don't call deprecated value

* pass value decoder instead of lambda

* move PrimitiveValueDecoders to codegen package

* rename from FromValue to ValueDecoder

* rename from method fromValue to valueDecoder

* extract isVariantRecord

* remove unused import

* added java doc for valueDecoder method

* format

* address comments

* address comments
2022-09-29 09:16:00 +01:00
azure-pipelines[bot]
78c3a1c548
bump canton to 20220928 (#15128)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-09-29 10:13:25 +02:00
Sergey Kisel
207160875c
Ignore broken not yet released protobuf feature. (#15124)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-29 07:25:52 +02:00
pbatko-da
f2a1d6c8ca
Conformance tests: Ensure unique test identifiers per suite rather than globally (#15118)
changelog_begin
changelog_end
2022-09-28 15:09:02 +02:00
nickchapman-da
68b323635d
[engine] prefer lastLocation to stackTrace (#15111)
TLDR: Remove broken code which constructs stackTrace().
Happy never to have to read those NOTE(MH) comments in the pushLocation code again!

(1) This code was fundamentally broken for various reasons:
- It doesn't make sense to track location info on the continuation stack. The continuation stack is a record of the evaluation still to come; not a context for the current evaluation.
- Stack traces can't sensibly be provided in a language such as Daml which promises that tail-recursion is evaluated in constant stack-space.
- Attempting to keep location info on the continuation stack does not play well when exceptions are thrown and the stack is unwound.

(2) The stack-trace management code was also very hacky:
- The pushLocation code contained special cases when the continuation stack was headed by a KArg/SToken continuation. This is an internal implementation detail. The KArg doesn't even exist when we stop using the deprecated SEAppGeneral expression constructor.
- The pushLocation code also contained special support for copying stack-traces into SEVal and SDefinition caches, and then later back on to the continuation stack. Yuck!

(3) The stackTrace() code was barely used:
- Some time ago an alternative/simpler location tracking system (lastLocation) was implemented.
- Only ScenarioRunner makes use of the stackTrace()
- Only a single test changes behaviour when we drop use of stackTrace() in favour of getLastLocation
2022-09-28 13:15:08 +01:00
Chun Lok Ling
0a0b32e808
use Objects.equals instead (#15094)
* use Objects.equals instead

CHANGELOG_BEGIN
CHANGELOG_END

* add () back

* specfy type of object to avoid java.io.Serializable being inferred which wartremover doesn't like it

* remove warnings

* address Stephen's comment

* address Stephen's comment
2022-09-28 12:15:26 +01:00
Moisés Ackerman
8411a960b1
Daml Studio: Suggested type signatures no longer qualify HasField typeclass (#15106)
* Add test for typesignature.add codelens with HasField

* Reexport class HasField from DA.Internal.RebindableSyntax

* Update expected signature in test for typesignature.add codelens with HasField

changelog_begin
- [Daml Studio] Suggested type signatures no longer qualify HasField typeclass
  See `#13790 <https://github.com/digital-asset/daml/issues/13790>`__.
changelog_end

* Update expected error in RelTimeDetailsHidden1 daml-test-file
2022-09-28 10:38:32 +00:00
azure-pipelines[bot]
80df435408
update compat versions (2022-09-28) (#15115)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-09-28 12:14:49 +02:00
azure-pipelines[bot]
9083576b78
rotate release duty after 2022-09-28 (#15113)
@akrmn is taking care of [testing](https://github.com/digital-asset/daml/blob/main/release/RELEASE.md) today's release, so they get pushed back to the end of the line.

Please do not merge this before the release is fully tested.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-09-28 12:13:59 +02:00
azure-pipelines[bot]
fe47255cd7
bump canton to 20220927 (#15114)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-09-28 11:13:32 +02:00
pbatko-da
7652944a9c
Improve wording of the conveyance message in error codes docs (#15043)
changelog_begin
changelog_end
2022-09-28 08:55:12 +00:00
Hubert Slojewski
9102247857
Prevent ledger-api-test-tool's Reporter from throwing misleading NPEs [KVL-1580] (#15109)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-28 10:51:32 +02:00
Moisés Ackerman
e0678718f4
Remove HLS plugins ormolu and fourmolu (#15110)
changelog_begin
changelog_end
2022-09-28 09:57:16 +02:00