Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only resolve template id once #9837

Merged
merged 1 commit into from
May 31, 2021
Merged

Only resolve template id once #9837

merged 1 commit into from
May 31, 2021

Conversation

cocreature
Copy link
Contributor

While looking at errors produced during command submissions I got
confused by the fact that we resolve the template id in the command
service. Turns out there is no reason for doing that, our types are
just not precise enough. This PR fixes that by making sure that we
differentiate between commands where the template id has been resolved
and those where it hasn’t.

changelog_begin
changelog_end

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

While looking at errors produced during command submissions I got
confused by the fact that we resolve the template id in the command
service. Turns out there is no reason for doing that, our types are
just not precise enough. This PR fixes that by making sure that we
differentiate between commands where the template id has been resolved
and those where it hasn’t.

changelog_begin
changelog_end
@cocreature
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@cocreature
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@cocreature cocreature merged commit 25b7e54 into main May 31, 2021
@cocreature cocreature deleted the resolvetmplid branch May 31, 2021 06:50
azure-pipelines bot pushed a commit that referenced this pull request Jun 2, 2021
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@cocreature is in charge of this release.

Commit log:
```
7d716e6 Try to unflake JSON API failure tests (#9855)
2d49939 Fix the notion of transaction equivalence in the ledger model for exceptions. (#9850)
fd8f8a6 Daml-lf suffixCid ignores V0 contract ids rather than erroring (#9867)
e38bb4a Make data-deps exception tests version-aware. (#9870)
94129b2 Add tests for decoding of UpdateTryCatch (#9865)
1cc0906 Adda test for an unhandled builtin exception to ExceptionTest.scala (#9866)
d7c60f5 resources: Only mutate test mock objects inside `synchronized` blocks. (#9869)
3a0b2f9 remove 2x 8020 todo tags (#9868)
1595f06 Special case _tryCatch @update in LFConversion. (#9864)
c0359ac Add trace context propagation in CommandClient.trackCommandsUnbounded [KVL-961] (#9833)
2a1e1ba Add a Foldable instance for Set (#9860)
590b8b3 Reshuffle tests for AnyExceptionMessage (#9863)
89bd478 Reenable AnyException tests in ExceptionTest.scala (#9861)
1573984 Include rollback nodes in danglingRefGenNode (#9851)
e5d4553 Remove flyway warning when using the append-only schema (#9840)
a4e33c9 Add metrics to parallel indexer (#9841)
972af2a Test To/FromAnyException primitives in DecodeV1Spec (#9852)
5f4f019 update NOTICES file (#9859)
f5f2a8a Remove obsolete transaction todo (#9853)
8fc4543 Uniform configuration of the command service across all ledgers (#9839)
1f4a958 ledger-api-bench-tool - single-value metrics (#9822)
6a1c797 ledger-api-bench-tool: TLS support (#9824)
5528347 Test TransactionsReader.getContractStateEvents within the JDBC DAO suite (#9849)
6af6c93 Fix behavior of Math.sqrt at 0 (#9818) (#9828)
7855ea5 Switch to Ubuntu 20.04 nodes for ghc lib (#9838)
c0fccfc Switch Scala version Bazel config (#9848)
e033277 Switch to our own nodes for releases (#9845)
b6a89a6 Bump ws to address security advisory (#9844)
25b7e54 Only resolve template id once (#9837)
a645971 Enable mutable-contract-state-cache for ledger-on-SQL append-only tests (#9836)
dcd33a7 Add a section on exceptions to the Daml intro (#9832)
859cae3 [Mutable contract state cache] Tests for contract/key state new methods in ContractsReader (#9825)
ffe5586 Track oldChild in PartialTransaction context (#9815)
6e17e2d [In memory fan-out] Transaction log updates stream implementation (#9792)
a0373c4 Ledger model section on transaction normalization. (#9816)
f355931 Fix typeclass detection in data-dependencies (#9830)
9626a59 Speedy: Clean SBuiltin (#9829)
269237e Fix authorization in try contexts (#9823)
cb06fb3 `ledger-api-bench-tool` - min consumption speed SLO [DPP-401] (#9808)
0868324 update NOTICES file (#9827)
a166e79 Added maxlength information to id string (#9826)
63bc0d1 EventsBuffer implementation for in-memory fan-out for Ledger API serving (#9775)
0c12259 Speedy: Use SAny instead of SAnyException to reperesent AnyExcpetion (#9819)
6caa61c participant-state: rejection reason abstractions (#9764)
63c471f Upgrade protobuf-java and scalapb. [KVL-938] (#9713)
f177c1a `ledger-api-bench-tool` - Moved classes to individual files [DPP-401] (#9803)
a3b10dc LF: fix parser (#9809)
9f55da8 update NOTICES file (#9812)
6846dbf update compat versions for 1.14.0-snapshot.20210526.7024.0.aedb9a82 (#9806)
1f021b2 LF: Drop Builtin Exceptions completly (#9790)
ea5b710 rotate release duty after 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9795)
0c7b149 Add reference docs for exceptions (#9807)
6b67ba0 LF: SBAnyExceptionMessage queries for unknown packages. (#9804)
fdab1e6 Parallelize daml-assistant integration tests. (#9802)
2e9c56e DPP-393 Activate JdbcLedgerDao suite for the append-only schema (#9793)
274fcae release 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9801)
3241ad6 `ledger-api-bench-tool` - updated metrics reporting model [DPP-400] (#9749)
```
Changelog:
```
Modify command line options of the ledgers based on the kvutils/app library:
- Remove max-commands-in-flight sub-option from the participant group.
- Add command service configuration options in line with sandbox and daml-on-sql: max-commands-in-flight, max-parallel-submissions, input-buffer-size
- [Integration Kit] - TLS support for the ledger-api-bench-tool
[Daml Compiler] Ensure that sqrt(0.0) == 0 and 0 ** 0 == 1
- [Integration Kit] - ledger-api-bench-tool - new consumption speed service-level objective for the ledger-api-bench-tool, configurable with a CLI parameter --min-consumption-speed
- Participant-state: Introduced versioned form of rejection reason
- [Integration Kit] - ledger-api-bench-tool - new parameter max-delay for specifying the service-level objective for max delay
```

CHANGELOG_BEGIN
CHANGELOG_END
cocreature pushed a commit that referenced this pull request Jun 2, 2021
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@cocreature is in charge of this release.

Commit log:
```
7d716e6 Try to unflake JSON API failure tests (#9855)
2d49939 Fix the notion of transaction equivalence in the ledger model for exceptions. (#9850)
fd8f8a6 Daml-lf suffixCid ignores V0 contract ids rather than erroring (#9867)
e38bb4a Make data-deps exception tests version-aware. (#9870)
94129b2 Add tests for decoding of UpdateTryCatch (#9865)
1cc0906 Adda test for an unhandled builtin exception to ExceptionTest.scala (#9866)
d7c60f5 resources: Only mutate test mock objects inside `synchronized` blocks. (#9869)
3a0b2f9 remove 2x 8020 todo tags (#9868)
1595f06 Special case _tryCatch @update in LFConversion. (#9864)
c0359ac Add trace context propagation in CommandClient.trackCommandsUnbounded [KVL-961] (#9833)
2a1e1ba Add a Foldable instance for Set (#9860)
590b8b3 Reshuffle tests for AnyExceptionMessage (#9863)
89bd478 Reenable AnyException tests in ExceptionTest.scala (#9861)
1573984 Include rollback nodes in danglingRefGenNode (#9851)
e5d4553 Remove flyway warning when using the append-only schema (#9840)
a4e33c9 Add metrics to parallel indexer (#9841)
972af2a Test To/FromAnyException primitives in DecodeV1Spec (#9852)
5f4f019 update NOTICES file (#9859)
f5f2a8a Remove obsolete transaction todo (#9853)
8fc4543 Uniform configuration of the command service across all ledgers (#9839)
1f4a958 ledger-api-bench-tool - single-value metrics (#9822)
6a1c797 ledger-api-bench-tool: TLS support (#9824)
5528347 Test TransactionsReader.getContractStateEvents within the JDBC DAO suite (#9849)
6af6c93 Fix behavior of Math.sqrt at 0 (#9818) (#9828)
7855ea5 Switch to Ubuntu 20.04 nodes for ghc lib (#9838)
c0fccfc Switch Scala version Bazel config (#9848)
e033277 Switch to our own nodes for releases (#9845)
b6a89a6 Bump ws to address security advisory (#9844)
25b7e54 Only resolve template id once (#9837)
a645971 Enable mutable-contract-state-cache for ledger-on-SQL append-only tests (#9836)
dcd33a7 Add a section on exceptions to the Daml intro (#9832)
859cae3 [Mutable contract state cache] Tests for contract/key state new methods in ContractsReader (#9825)
ffe5586 Track oldChild in PartialTransaction context (#9815)
6e17e2d [In memory fan-out] Transaction log updates stream implementation (#9792)
a0373c4 Ledger model section on transaction normalization. (#9816)
f355931 Fix typeclass detection in data-dependencies (#9830)
9626a59 Speedy: Clean SBuiltin (#9829)
269237e Fix authorization in try contexts (#9823)
cb06fb3 `ledger-api-bench-tool` - min consumption speed SLO [DPP-401] (#9808)
0868324 update NOTICES file (#9827)
a166e79 Added maxlength information to id string (#9826)
63bc0d1 EventsBuffer implementation for in-memory fan-out for Ledger API serving (#9775)
0c12259 Speedy: Use SAny instead of SAnyException to reperesent AnyExcpetion (#9819)
6caa61c participant-state: rejection reason abstractions (#9764)
63c471f Upgrade protobuf-java and scalapb. [KVL-938] (#9713)
f177c1a `ledger-api-bench-tool` - Moved classes to individual files [DPP-401] (#9803)
a3b10dc LF: fix parser (#9809)
9f55da8 update NOTICES file (#9812)
6846dbf update compat versions for 1.14.0-snapshot.20210526.7024.0.aedb9a82 (#9806)
1f021b2 LF: Drop Builtin Exceptions completly (#9790)
ea5b710 rotate release duty after 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9795)
0c7b149 Add reference docs for exceptions (#9807)
6b67ba0 LF: SBAnyExceptionMessage queries for unknown packages. (#9804)
fdab1e6 Parallelize daml-assistant integration tests. (#9802)
2e9c56e DPP-393 Activate JdbcLedgerDao suite for the append-only schema (#9793)
274fcae release 1.14.0-snapshot.20210525.7017.0.2710fad0 (#9801)
3241ad6 `ledger-api-bench-tool` - updated metrics reporting model [DPP-400] (#9749)
```
Changelog:
```
Modify command line options of the ledgers based on the kvutils/app library:
- Remove max-commands-in-flight sub-option from the participant group.
- Add command service configuration options in line with sandbox and daml-on-sql: max-commands-in-flight, max-parallel-submissions, input-buffer-size
- [Integration Kit] - TLS support for the ledger-api-bench-tool
[Daml Compiler] Ensure that sqrt(0.0) == 0 and 0 ** 0 == 1
- [Integration Kit] - ledger-api-bench-tool - new consumption speed service-level objective for the ledger-api-bench-tool, configurable with a CLI parameter --min-consumption-speed
- Participant-state: Introduced versioned form of rejection reason
- [Integration Kit] - ledger-api-bench-tool - new parameter max-delay for specifying the service-level objective for max delay
```

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
S11001001 added a commit that referenced this pull request Nov 12, 2021
* Support deletion of a large number of contracts (#10353)

Backport of #10353 / 9c9b91e.

* Support deletion of a large number of contracts

fixes #10339

There are two orthogonal issues here:

1. scalaz’s toVector from the Foldable[Set] instance
   stackoverflows. I’ve just avoided using that altogether.
2. Oracle doesn’t like more than 1k items in the IN clause. I chunked
   the queries into chunks of size 1k to fix this.

changelog_begin

- [JSON API] Fix an error where transactions that delete a large
  number of contracts resulted in stackoverflows with the PostgreSQL
  backend and database errors with Oracle.

changelog_end

* fix benchmark

changelog_begin
changelog_end

* Update ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala

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

* Update ledger-service/db-backend/src/main/scala/com/digitalasset/http/dbbackend/Queries.scala

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

* that's not how you foldA

changelog_begin
changelog_end

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

* backport past some moves and type parameter adds

* backport encodeCreateAndExerciseCommand from #9837 / 25b7e54

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants