Commit Graph

566 Commits

Author SHA1 Message Date
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
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
Stephen Compall
9f1033a6ec
remove some domain.TemplateId usages (#15097)
* replace several TemplateId with ContractTypeId
* replace several TemplateId with ContractTypeId.Template
* deprecate, even though this misses so many usages
* link to #15098 for followups

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-27 07:53:10 -04:00
Stephen Compall
c1cde096b2
replace OneAnd with NonEmpty for query templateIds (#15088)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-26 16:06:58 +00:00
mziolekda
41dc32a016
Remove reliance on implicit party allocation in CI tests [DPP-1234] (#15037)
* Remove reliance on implict party allocation in the authorization tests of the sandbox-on-x

CHANGELOG_BEGIN
CHANGELOG_END

* Remove the HOCON and cli config parameters

* Remove implicit party allocation from the Submission Service

* Remove support for implicit parties from the bridge

* Fix codegen reliance on implicit party allocation

* Fix daml script tests

* Fix trigger tests

* format security-evidence.md post rebase

* Fix json-api tests

* One more json-api test

* Fix haskell tests

* Corrections post-review

* Cosmetic improvements

* Fix race condition in party allocation handling
2022-09-22 10:20:53 +02:00
Stephen Compall
77672d2896
better JsNull check for Oracle; test scenarios for nested cases (#15022)
* a couple comparison query scenarios with nested position
* same JSON null test, but different
- 'gt string' (scenario 0) fails without this change
- 'gt int' (scenario 1) succeeds regardless of this change

CHANGELOG_BEGIN
- [JSON API with Oracle] Fix some nested queries that were returning no
  data.  DisableContractPayloadIndexing must be set to true to take
  advantage of this fix.
CHANGELOG_END
2022-09-21 10:21:35 +00:00
Stephen Compall
a9ebecfe5c
retest Oracle with payload indexing (#15041)
* point to #14844 and #15040 for some TODOs
* duplicate the Oracle tests, disable large literals when indexing is on
* split test file for parallelization

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-20 10:32:58 -04:00
Stephen Compall
36e49c737b
factor stream-starting code in websocket JSON API tests (#15008)
CHANGELOG_BEGIN
CHANGELOG_END
2022-09-13 19:26:59 +00:00
Stephen Compall
5bec0ba4d2
remove redundant StatusCode checks from many tests (#15007)
* ensure Status is redundant for every parseResponse user
* make parseResponse test and discard the HTTP status
* use resultContractId more

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-13 09:40:49 -04:00
Chun Lok Ling
419bf9b040
Fire a warning if both config file and cli opts found. (#14981)
* fire a warning if both config file and cli opts found.

* add change log

CHANGELOG_BEGIN
CHANGELOG_END

* fixes test case

* fmt
2022-09-08 21:22:25 +01:00
Chun Lok Ling
9b73243eea
Remove : ResolvedQuery from pattern match (#14972)
Addressed #14966

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-08 09:02:01 +01:00
atriantafyllos-da
2b89f6beea
One leeway config for all autorizers [DPP-1215]. (#14930)
* One leeway config for all autorizers [DPP-1215].

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-07 15:07:42 +02:00
Chun Lok Ling
32583edb7d
v1/stream/query interface subscription support (#14919)
* replace Set[TemplateId.Resolved] with ResolvedQuery in StreamPredicate val resolved
CHANGELOG_BEGIN
CHANGELOG_END

* make it compile first and fix those TODOs iteratively.

* `Unsupported or ResolvedQuery monoid` for collectively combine `ResolvedQuery`s; handle unsupported cases

* cleanup todo

* cleanup

* use resolvedQuery instead and add change log

CHANGELOG_BEGIN
CHANGELOG_END

* compile

CHANGELOG_BEGIN
CHANGELOG_END

* added test cases

CHANGELOG_BEGIN
CHANGELOG_END

* Address Ray's comment

CHANGELOG_BEGIN
Users can now subscribe `v1/stream/query` with queries with single interface id.
CHANGELOG_END

* Address Ray's comment

* Address Ray's comment

* fmt

* fix error message

* fix error message

* Addressed Stephen's comment

* Addressed Stephen's comment

* Addressed Stephen's comment
2022-09-07 09:20:23 +01:00
Raymond Roestenburg
fbe3d94bfe
14818 fetch by contract id with interface (#14917)
* Fallback to in-memory for interface ID.

CHANGELOG_BEGIN
- [JSON API] /v1/fetch by interface ID
CHANGELOG_END

* Added fix: not setting key in ActiveContract in interface case, fix for https://github.com/digital-asset/daml/pull/14841#discussion_r961960344
2022-09-06 11:03:31 +02:00
Raymond Roestenburg
d13695c75e
Draft /v1/query with interface ID, without query store (#14841)
Support /v1/query by interfaceID or a non-empty set of template ID's, fallback to in-memory for an interfaceId query.

Co-authored-by: Stephen Compall <stephen.compall@daml.com>


CHANGELOG_BEGIN
- [JSON API] /v1/query with a non-empty set of template ID’s or one interface ID
CHANGELOG_END
2022-09-02 12:49:06 +02:00
Chun Lok Ling
2a01863c96
Test cases to ensure retroactive implements works in json-api (#14874)
* fixes #14821, added test case to ensure retroactive implements works in json-api

CHANGELOG_BEGIN
CHANGELOG_END

* address Stephen's comment
CHANGELOG_BEGIN
CHANGELOG_END
2022-08-31 07:10:38 +01:00
Stephen Compall
99a48557d3
deprecate interface library names; use new names downstream (#14856)
* new names in daml-script/runner

* new names in json-api

* new names in Scala bindings/codegen

* new names in Java bindings/codegen

* new names in daml-lf interpreter tests

* more new names in daml-script tests

* new names in navigator backend

* deprecate all iface symbols and old method names

CHANGELOG_BEGIN
- [Scala API] ``com.daml.lf.iface`` has been deprecated, as discussed
  further in
  `issue #14783 <https://github.com/digital-asset/daml/pull/14783>`__.
  Use the deprecation warnings as guidance to the new names.
CHANGELOG_END

* prefix cases in OrderingSpec

- suggested by @remyhaemmerle-da; thanks
2022-08-29 20:43:47 +00:00
Stephen Compall
6236c8cc02
propagate template/interface ID distinction throughout JSON API (#14728)
* percolate Resolved/Definite status

* propagate resolution through the queries, DB updates, and domain resolutions

* include Definite in the definition of Resolved, everywhere

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-29 15:41:20 +00:00
Stephen Compall
f43bc5c8d1
use new api-type-signature names in some dependents (#14785)
* use new names in json-api

* use new names in java codegen

* use new names in Scala codegen

* use new names in TypedValueGenerators

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-23 17:52:10 +00:00
Stephen Compall
f85f7816c7
rename interface library to api-type-signature; alias symbols (#14783)
* move interface directory to api-type-signature; change bazel target; move scala files

* rename iface package to typesig; rename EnvironmentInterface to EnvironmentSignature

* rename Interface to PackageSignature

* rename fromReaderInterfaces to fromPackageSignatures

* rename InterfaceReader to SignatureReader

* rename InterfaceReader to SignatureReader in deprecation note

* rename readInterface to readPackageSignature

* rename InterfaceReaderError to Error

* rename InterfaceReaderMain to SignatureReaderMain

* rename InterfaceType to PackageSignature.TypeDecl

* rename astInterfaces to interfaces

* rename astInterfaces to interfaces in PackageSignature

* rename findAstInterface to findInterface

* rename a couple arguments

CHANGELOG_BEGIN
- [Scala API] The "quasi-public" API in ``com.daml.lf.iface`` has moved
  to the new ``com.daml.lf.typesig`` package, with many accompanying
  name changes as documented in `issue #13669
  <https://github.com/digital-asset/daml/issues/13669>`__.

  Daml 2.5.0 or later will remove the old names, and also rename the
  Maven artifact from ``daml-lf-interface`` to
  ``daml-lf-api-type-signature``.  We recommend that users of this API
  use the deprecation guidance in 2.4.0 to port their applications
  before this happens.
CHANGELOG_END
2022-08-23 15:21:45 +00:00
atriantafyllos-da
7ff003a6aa
Rename the leeway options [DPP-1183]. (#14679)
* Rename the leeway options [DPP-1183].

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-23 10:24:41 +02:00
Chun Lok Ling
56a4d6476f
Added logging for time elapsed of ledger client call (#14711)
* Added logging for time elapsed of ledger client call

CHANGELOG_BEGIN
CHANGELOG_END

fixes #14673

* rename logging def

* ADDED TODO

* ADDED TODO

* pass in boolean for determining if it should log based on the log level

* address Ray's comment. Wrong name Ledge -? Ledger

* make isEnable public and use it to determin whether it is debug level

* refactoring. put everything in a inner object LedgerClientRequestTimeLogger

* remove useless line

* address Ray's comment

* address Ray's comment

* log the time used for source as well

* address Stephen's address
2022-08-22 21:14:38 +01:00
Simon Maxen
937f8d1d45
Switch metering report to using Struct [DPP-1135] (#14767)
* Switch metering report to using Struct

changelog_begin
changelog_end
2022-08-22 08:55:06 +01:00
Chun Lok Ling
24c4c058b8
don't use query store at ledger-begin (#14740)
* fixes 11157

```rst
CHANGELOG_BEGIN
CHANGELOG_END
```

* format

* fix it in other caller
2022-08-17 18:58:56 +01:00
Moisés Ackerman
009c3c306b
Add interface instance syntax, including retroactive interface instances (#14715)
* Extract qualifyLocally in LFConversion

* Update ghc rev

* Add parent type argument to interface instance desugaring types

* Check interface instance parent in LFConversion

* Convert interface instances in interface declarations

* Update daml-test-files to use 'interface instance' syntax

* Update other tests to use 'interface instance' syntax

* Update interface reference docs to use 'interface instance' syntax

* Update other files to use 'interface instance' syntax

* Add todo in DA.Daml.LF.Ast.Pretty

* Add daml-test-files for retroactive interface instances

changelog_begin
changelog_end
2022-08-17 12:06:59 +00:00
Stephen Compall
22d2c27c4b
distinguishing template and interface IDs in json-api (#14577)
* prevent subclasses from having different equals behavior
* introduce a nominal, matchable subtype for interface IDs

CHANGELOG_BEGIN
CHANGELOG_END
2022-08-15 11:15:00 -04:00
dylant-da
0d37134bc2
Change placeholder unit viewtypes to empty records (#14656)
* Update views in integration-v1dev to be EmptyInterfaceView instead of ()

* Update expected desugared daml for `EmptyInterfaceView`

* Update compiler Shake / DataDependencies viewtypes to EmptyInterfaceView

* Add record viewtypes to docs, update docs

* Add empty records to daml-lf, language-support, ledger, trigger tests

* Qualify EmptyInterfaceView in ledger semantic Interface tests

* Fix imports for EmptyInterfaceView in IIou / CIou / Transferrable

* empty changelog commit

CHANGELOG_BEGIN
CHANGELOG_END

* Qualify EmptyInterfaceView import

* Fix imports of EmptyInterfaceView in TypeScript codegen tests

* Accept Interface doc changes

* Add EmptyInterfaceView to DataDependencies tests

* Remove missing interface viewtype test - all interfaces must have views

* Replace all EmptyInterfaceView with EmptyInterfaceView {}
2022-08-10 16:45:23 +00:00
dylant-da
8e8e0dabdf
Convert viewtype and view methods to LF (#14456)
* Add DA_Internal_Interface to convertTypeDef exclusion check

* Move desugared types/values for interface views into DA.Internal.Desugar

* Convert viewtype and view method declarations

* Typecheck view types and view declarations

* Add unit viewtypes to InterfaceChoiceCollision tests

* Add unit viewtypes to more compiler/damlc tests

* Modify empty interfaces/implements to have viewtypes/views

* Add unit viewtypes to remaining Interface tests

* Test for error thrown when viewtype not specified

* Fix daml-lf/ interface tests to use new syntax / unit views

* Add placeholder view of type Unit to TestInterfaces

CHANGELOG_BEGIN
CHANGELOG_END

* Fix typescript interface tests with unit viewtype

* Add unit viewtype to Java & Scala codegen

* Add unit viewtype to triggers tests interface

* Add unit viewtypes to ledger/test-common

* Add unit viewtypes to ledger-service/http-json

* Fix some damlc tests

* Use viewtype syntax in InterfaceViewNonSerializable test

* Remove HasInferfaceView instances in convertBind

* Add unit view to QualifiedInterface.daml test

* Generate HasInterfaceView instances in DataDependencies

* Add unit viewtypes and views to compiler/damlc/tests

* Document reconstruction of HasInterfaceView

* Move desugared types/values for interface views into DA.Internal.Desugar

* Add desugarable function view w/ EViewInterface desugaring

* Remove templateName and viewtype from generated EViewInterface

* Update desugared-daml

* Proof of concept: use _view -> EViewInterface prim via HasInterfaceView

* Move view, HasInterfaceView to DA.Internal.Interface

* Update desugared-daml tests

* Stop removing and re-generating HasInterfaceView instances

* Do not generate docs for generated "_view_" methods

* Report errors with interface TypeConNames prettily

* Fix InterfaceViewNotSpecified @ERROR to reflect new error text

* Don't import magic `view` method from Prelude to avoid name clash

* Update shake interface goto definition test locations

* Temp disable view spec tests, will re-implement views in speedy

* Add unit viewtype to Java code snippet docs

* Update Interface syntax docs for views

* Add unit viewtype to Transferrable.daml

* Add back "empty" interface implementation to interfaces.rst

* Re-enable view tests by having _view methods on InterfaceViews.daml file

* Remove deprecated commented-out view desugaring code
2022-08-03 16:23:38 +01:00
Stephen Compall
1a9dc020f9
overloaded choices in json-api (#14410)
CHANGELOG_BEGIN
- [JSON API] For exercise endpoints, when multiple choices with the same
  name are defined, the one directly defined on the ``templateId``,
  which may be a template or interface ID, will be selected; if a
  template ID is specified that only inherits the choices with the same
  name, the new ``choiceInterfaceId`` option must be specified to select
  the source of the choice.
CHANGELOG_END
2022-07-27 15:40:58 +00:00
Stephen Compall
8309cfef1e
group JSON API tests by endpoint, other categories (#14522)
* group query tests
* group remaining abstract integration tests
* group user management tests
* group websocket tests

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-26 11:50:04 -04:00
Sergey Kisel
2e18276b1a
Unify TlsConfiguration between SDK and canton [DPP-1113] (#14349)
* Unify TlsConfiguration between SDK and canton [DPP-1113]

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-14 16:58:59 +02:00
atriantafyllos-da
8cce2c0394
DPP-1047 Added leeway options for JWT-based authorization. (#14375)
* DPP-1047 Added leeway options for JWT-based authorization.

CHANGELOG_BEGIN
CHANGELOG_END
2022-07-13 14:57:54 +02:00
Stephen Compall
6e3069d220
add retroImplements to lf/iface DefInterface (#14192)
* add resolveRetroImplements to EnvironmentInterface
* test that resolveRetroImplements does nothing with no data
* resolve retroactive interfaces in Java codegen
* resolve retroactive interfaces in Scala codegen
* resolve retroactive interfaces in json-api

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-29 13:13:02 -04:00
Victor Peter Rouven Müller
8d21d19133
Add support for cmd deduplication & submission id for cmd submissions (#13771)
* Add completion offset to cmd submission responses

changelog_begin
- [HTTP-JSON] there is now a new meta field called deduplicationPeriod for cmd submissions with which one can specify the deduplication period. Moreover there also is another new meta field submissionId for the cmd submissions.
- [HTTP-JSON] Calls to endpoints for command submission now include the completion offset
changelog_end

Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
2022-06-29 16:57:05 +00:00
Stephen Compall
90ca397bc5
replace remaining RNil usages with shapeless.record.Record (#14275)
* deprecate RNil

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-28 19:16:25 +00:00
Sergey Kisel
6a80a1a82f
Removal of sandbox-classic module and binary (#14201)
* Removal of sandbox-classic module and binary

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-21 11:09:51 +02:00
Stephen Compall
707c3e1a52
accept standard hlists as record/variant specs (#14167)
* link to #14189

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Raymond Roestenburg <98821776+ray-roestenburg-da@users.noreply.github.com>
2022-06-16 15:05:50 +00:00
Stephen Compall
19ad1be8f2
use domain.Party instead of String in json-api tests (#14158)
* use domain.Party instead of String for iouCreate{,AndExerciseTransfer}Command

CHANGELOG_BEGIN
CHANGELOG_END
2022-06-15 08:59:23 -04:00
Sergey Kisel
1d8f195438
Sandbox Classic Removal in Tests (#13934)
CHANGELOG_BEGING
CHANGELOG_END
2022-06-07 19:54:52 +00:00
Stephen Compall
7c23420876
use more domain models for json-api response tests (#14101)
CHANGELOG_BEGIN
CHANGELOG_END
2022-06-07 08:57:17 -04:00
Stephen Compall
96a6fe62e4
choice name overloading in lf/interface (#13938)
* introduce TemplateChoices to mediate template choice resolution
* if any resolutions fail in EnvironmentInterface, discard the template's resolution
* if any resolutions fail in Interface, discard the remaining unresolved

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-31 08:41:48 -04:00
Sergey Kisel
168f943ff0
Revise the config to use a hierarchical structure [DPP-1029] (#13629)
* Revise the config to use a hierarchical structure [DPP-1029]

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-30 18:02:53 +02:00
Stephen Compall
a716428ebc
replace hand-disassembly of json in tests with domain model values (#13960)
* make postJsonRequestWithMinimumAuth parse, and make all its callers declarative
* make getRequestWithMinimumAuth parse, and make all its callers declarative
* note about further cleanup

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 06:31:06 -04:00
Stephen Compall
04c37349fc
refactor contract/party endpoint functions to endpoints package (#13955)
* move fetch, retrieveAll, query to separate module
* move parties endpoints to separate module
* narrow some access as all endpoint functions have moved

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 06:29:51 -04:00
Stephen Compall
b307cd8406
remove some contract-ID generality from TypedValueGenerators (#13957)
* move where ContractId arbitrary instance passes into ValueAddend
* adjust ValueAddend users to deal with moved Arbitrary instance

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-24 06:28:34 -04:00
Stephen Compall
97f3f4f956
reduce fixture-passing boilerplate in json-api tests (#13829)
* move the fixture data to a single value, make utilities extend off it
* start unifying the with* functions

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-23 16:16:35 +00:00
Remy
6f6a3052a1
Repurpose templateId in ExerciseCommand and add interfaceId in ExerciseEvent (#13660)
part of #13653

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-16 15:30:07 +00:00
Sergey Kisel
e32a1e680a
Increase public key cache size for Jwks [DPP-681] (#13802)
* Increase public key cache size for Jwks to decrease the risk of DDOS attack.

CHANGELOG_BEGIN
CHANGELOG_END

* Update ledger-service/jwt/src/main/scala/com/digitalasset/jwt/JwksVerifier.scala

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

Co-authored-by: Robert Autenrieth <31539813+rautenrieth-da@users.noreply.github.com>
2022-05-06 11:33:00 +00:00
Sergey Kisel
50c0f233e8
Address review concerns on security test evidence. (#13794)
* Address review concerns on security test evidence.

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-05 14:12:05 +00:00