Commit Graph

10756 Commits

Author SHA1 Message Date
Nicu Reut
4b503b7e8c
Upgrade the prometheus client version [PLEN-4] (#15211) 2022-10-13 07:07:45 +02:00
Chun Lok Ling
74dd242984
Typed ACS and transaction streams for Java codegen (#15159)
* added transactionFilter

* move transactionFilter to `TransactionFilter`

* fromCreatedEvent

* format

* added getTransaction with contract type companion

* ACS using contract type companion

* position

* add change log

CHANGELOG_BEGIN
CHANGELOG_END

* Ct

* Ct

* format

* better exception

* fixed test cases

* added java doc and rename method to GetContracts

* address Stephen's comments

* address Stephen's comments

* address Stephen's comments

* remove unused import

* format

* address Stephen's comments

* address Stephen's comments

* Make some codegen code to be java 8 compatible; Modify IouMain to use the new getActiveContracts. to address Stephen's comments

* use 1.11, no need to be java 8 compatible

* revert

* 11 not 1.11
2022-10-12 21:01:01 +01:00
carrielaben-da
a49dd9ed8c
Update initaccept.rst (#15218)
Addressing the missing word issue noticed by Craig, plus some additional improvements.

[CHANGELOG_BEGIN]
[CHANGELOG_END]

Co-authored-by: carrie-laben <91496516+carrie-laben@users.noreply.github.com>
2022-10-12 13:54:51 -04:00
azure-pipelines[bot]
71206050a7
rotate release duty after 2022-10-12 (#15219)
@S11001001 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-10-12 13:52:40 -04:00
fayi-da
ae70c97390
Ensure interface generation uses package prefixes (#15215)
* Ensure interface generation uses package prefixes

CHANGELOG_BEGIN
- [BUGFIX] Interface generation now respects package prefixes argument. This means generated interfaces will now be placed in the right subpackages.
CHANGELOG_END

* Prove that we get an error if interface is generated in the wrong directory

Command: bazel build //language-support/java/codegen:test-daml-java.jar

Error:
bazel-out/darwin_arm64-opt/bin/language-support/java/codegen/_javac/test-daml-java.jar/libtest-daml-java.jar_tmp/blah/ut/retro/InterfaceRetro.java:24: error: cannot find symbol
  public static final ChoiceMetadata<ut.retro.InterfaceRetro, Transfer, ut.retro.InterfaceRetro.ContractId> CHOICE_Transfer =
                                             ^
  symbol:   class InterfaceRetro
  location: package ut.retro
bazel-out/darwin_arm64-opt/bin/language-support/java/codegen/_javac/test-daml-java.jar/libtest-daml-java.jar_tmp/blah/ut/retro/InterfaceRetro.java:24: error: package ut.retro.InterfaceRetro does not exist
  public static final ChoiceMetadata<ut.retro.InterfaceRetro, Transfer, ut.retro.InterfaceRetro.ContractId> CHOICE_Transfer =

* Revert "Prove that we get an error if interface is generated in the wrong directory"

This reverts commit cc8612a8a3.
2022-10-12 16:13:06 +00:00
Stephen Compall
d03ed9c66b
add missing PrimitiveValueDecoders (#15195)
* add List, Optional, ContractId, TextMap primitive decoders

CHANGELOG_BEGIN
CHANGELOG_END

* add fromNumeric and fromGenMap

* generate less code for list, optional

* allow newline in assignment

* generate less code for contract ID

* generate less code for textmap

* generate less code for genmap

* use fromNumeric

* extra test for an indirect case

* javadoc fromTextMap, fromGenMap, impossible

* example of building value decoders with derived combinators
2022-10-12 09:46:25 -04:00
pbatko-da
8ae52ae3fa
Fix auto-generated proto docs (blank lines break tables in html docs) [DPP-1233] (#15214)
changelog_begin
changelog_end
2022-10-12 13:51:15 +02:00
azure-pipelines[bot]
d3e3d110ce
bump canton to 20221011 (#15220)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-12 09:39:33 +00:00
tudor-da
500a1f2ab2
Clean-up unused methods in MutableCacheBackedContractStore (#15213)
changelog_begin
changelog_end
2022-10-12 07:55:43 +00:00
dylant-da
cedb09825a
Only report coverage for package-local choices/templates (#15150)
* Only report coverage for package-local choices/templates, add extra info

* Unify information for printTestCoverage

* Extract modules from all packages & local modules, not just tested ones

* Create reports about local/external choices/templates

* Remove unnecessary reporting

* Report local package coverage, external package coverage, all coverage

* Refactor printReport

* fix test, satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Fix another test

* Fix wording to `defined in local/external package`

* Check coverage against all modules in scope, not just tested modules

* Fix wording again, back to local/external modules - more accurate

* Replace TemplateInfo with Qualified Template
2022-10-11 15:57:36 +00:00
atriantafyllos-da
ac8618aaed
Removed unused cache metrics [DPP-1246]. (#15149)
Removed unused cache metrics [DPP-1246].

CHANGELOG_BEGIN
The following metrics were removed from the metrics relevant to caches:
  - load_successes
  - load_failures
  - load_total_time
CHANGELOG_END
2022-10-11 16:39:56 +02:00
azure-pipelines[bot]
9affa377e5
rotate release duty after 2022-10-05 (#15164)
@garyverhaegen-da 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: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2022-10-11 15:35:10 +02:00
Stephen Compall
951817aee1
run query-store-independent tests less often (#15201)
* declare the separate kind of duplication

CHANGELOG_BEGIN
CHANGELOG_END

* move completely independent tests

* move many tests to 'QueryStoreIndependent'

* fix metering-report test to work with user tokens

* rename query-store/auth-dependent tests

- to QueryStoreAndAuthDependentIntegrationTest
- from AbstractHttpServiceIntegrationTestTokenIndependent

* security evidence moved
2022-10-11 09:27:07 -04:00
Stephen Compall
0d36c0ac17
javadocs for javaapi.data.codegen (#15209)
* link to #15207
* javadoc for ContractTypeCompanion and ChoiceMetadata
* link to #15208

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-11 09:26:28 -04:00
Marton Nagy
e5b173a9c4
Fix flaky test (#15205)
* Fix CommandServiceBackpressureIT by increasing load
* Make stage buffer size configurable (allows to limit the drain
effect of the heavily buffered pipeline)

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-11 15:20:21 +02:00
Gerolf Seitz
cc0ff448e0
Update rules_jvm_external to 4.4.2 (#15197)
rules_jvm_external 4.0 introduced the @maven//:outdated command, which
checks the dependencies for newer versions. This can help us keep the
dependency versions up-to-date.

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-11 12:49:43 +00:00
fayi-da
69f11311df
npm resolutions for daml extension (#15203)
* npm resolutions for daml extension

* Remove unnecessary dependencies

* No changelog

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-11 11:42:36 +00:00
Moisés Ackerman
7f19bf258a
Check package name of preprocessor-excepted modules (#15184)
* Ensure daml preprocessor is only skipped when building 'daml-{prim,stdlib}'

changelog_begin
changelog_end

* Test that the daml preprocessor can't be skipped simply by changing the module name
2022-10-11 12:11:36 +02:00
pbatko-da
80df42bfcb
[DPP-1239] Unify metadata related tests for party and user management services (#15104)
changelog_begin
changelog_end
2022-10-11 10:01:48 +02:00
azure-pipelines[bot]
ab62d1aebc
bump canton to 20221010 (#15210)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-11 06:43:48 +00:00
Nicu Reut
2f453a145c
Extract the testing metrics instance [PLEN-4] (#15192) 2022-10-10 18:52:49 +00:00
Carl Pulley
c710081ed3
Log Runner stream runtime exceptions at ERROR and with a stack trace
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-10 15:46:24 +01:00
nickchapman-da
490056ebf9
fix bug in pretty-print for empty kont-stack (#15179)
changelog_begin
changelog_end
2022-10-10 16:35:10 +02:00
Stephen Compall
70f118579c
remove some ResolvedQuery cases (#15000)
* introduce ForQuery to overload ActiveContract.fromLedgerApi
* remove booleans from ResolvedQuery.apply
* wrong error string
* use the fact that query is non-empty to hide the Empty case
* we definitely only need a Semigroup, which fixes the law violation
* remove Empty

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Chun Lok Ling <110462561+chunlokling-da@users.noreply.github.com>
2022-10-10 09:33:40 -04:00
Simon Maxen
c5cd904dba
Exclude zero counts from metering report (#15169)
changelog_begin
changelog_end
2022-10-10 13:45:05 +01:00
Simon Maxen
b9abbfdcbf
Allow the rate limiting interceptor to be passed to api services (#15190)
changelog_begin
changelog_end
2022-10-10 11:24:01 +01:00
azure-pipelines[bot]
3f3408f16f
bump canton to 20221007 (#15196)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-08 19:38:42 +02:00
fayi-da
d11704018a
Provide contract choice metadata (#15116)
* #13766 initial implementation of choice metadata for templates

* #13766 initial implementation of choice metadata for interfaces

* #13766 Add marker type to ContractTypeCompanion

* #13766 Minor type fix

* Cleanup after merge with main

* Temporary fix for package prefixes

* Format java files, rename Maker -> ContractType in ContractTypeCompanion

* Add documentation and tests

* Complete choice metadata implementation

CHANGELOG_BEGIN
- Add new representation of a choice, ChoiceMetadata.
- Generated templates and interfaces now include fields for each available choice. These fields will have a ChoiceMetadata type and will be called CHOICE_N, where N represents the choices' name.
CHANGELOG_END

* Update docs and cleanup tests
2022-10-07 20:54:43 +00:00
Stephen Compall
df2dd37735
mark parts of Java bindings final (#15173)
* mark several javaapi.data models final
* PrimitiveValueDecoders are final; utility classes should not be constructed
* replace Bool constructor with new #of static method

CHANGELOG_BEGIN
- [Java bindings] Many classes in the ``javaapi.data`` package that were
  *intended* to be ``final`` are now explicitly marked as such.
CHANGELOG_END
2022-10-07 18:04:03 +00:00
azure-pipelines[bot]
b7fccfc3b5
update NOTICES file (#15186)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-07 15:36:36 +02:00
azure-pipelines[bot]
9275fc0f57
bump canton to 20221006 (#15185)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines Daml Build <support@digitalasset.com>
2022-10-07 15:36:12 +02:00
Stephen Compall
7a85900e0c
update parse-url from 6.0.5 to 8.1.0 (#15183)
- CVE-2022-2900
- CVE-2022-3224

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-06 12:42:46 -04:00
nickchapman-da
4d5157b20e
remove dead code (#15181)
changelog_begin
changelog_end
2022-10-06 15:57:27 +00:00
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