Commit Graph

892 Commits

Author SHA1 Message Date
fabiotudone-da
5e4164c12d
LedgerFactory.metricsRegistry -> LedgerFactory.metrics: Metrics (#5914)
* `LedgerFactory.metricsRegistry` -> `LedgerFactory.metrics: Metrics`

CHANGELOG_BEGIN
CHANGELOG_END

* Address review comment
2020-05-08 19:00:58 +02:00
Samir Talwar
208d4a50da
postgresql-testing: Use a new, random database name every time. (#5911)
* postgresql-testing: Store the JDBC URL separately.

* postgresql-testing: Expose the username and password.

* postgresql-testing: Get the caller to create the database.

And make sure it's a random one, not "test".

CHANGELOG_BEGIN
CHANGELOG_END

* postgresql-testing: Only store the JDBC URL for tests.

Less mutable state, innit.

* postgresql-testing: Capture the individual JDBC URL parameters.

* Bazel: Fix PostgreSQL binary paths.

* postgresql-testing: Just recreate the database in PostgresAroundEach.

There's no need to restart the process with a different data directory.
2020-05-08 12:36:42 +00:00
Stefano Baghino
846391ac72
Use a table specifically for transaction trees witnesses (#5897)
* Use a table specifically for transaction trees witnesses

This allows to not re-compute those every time using the flat transaction
witnesses and the complement.

Furthermore, witness tables indexing is redefined to a single primary key
covering both event identifier and witness party instead of two
separated indexes. This has proven to be a relevant improvement for
performance.

Fixes #5883

changelog_begin
[Ledger API Server] Significant improvements in serving transaction trees. See #5883.
changelog_end

* Fix migration SHA
2020-05-07 19:19:28 +02:00
Samir Talwar
17f4dc2716
ledger-on-sql: Remove the reference to the removed "common" migrations. (#5888)
This is producing a warning.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-07 12:56:56 +00:00
Samir Talwar
a0635fa397
ledger-on-sql: Use dedicated database execution contexts. (#5869)
* ledger-on-sql: Use dedicated database execution contexts.

This may or may not stop us from monopolizing API server threads.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-on-sql: Name arguments to `Database` and `UninitializedDatabase`.
2020-05-07 11:52:24 +00:00
nickchapman-da
53b24793f4
Simplify and clarify the public interface to Speedy. (#5881)
* Simplify and clarify the public interface to Speedy.

- Remove `isFinal`. A client just uses `run()`.
- Remove `toSValue`. The value in available in `SResultFinalValue(v: SValue)`.
- A client never directly access the `.ctrl` (or `.returnValue`) components.
- A client may use `setExpressionToEvaluate(expr)` to evaluate a new expression on an existing machine.

changelog_begin
changelog_end

* remove while loop which executes just once

* avoid unnecessary mutation when running speedy
2020-05-07 08:55:16 +00:00
Robert Autenrieth
9ebfd01f83
Add script to dump metrics summary (#5828)
* Add script to dump metrics summary

CHANGELOG_BEGIN
CHANGELOG_END

* Sort results by default

* Address review comments

* Run prettier

* Refactor code

* Make script executable

* Address review comment

* Always take latest data point
2020-05-06 17:13:14 +02:00
Leonid Shlyapnikov
a79377cb2d
Improve DAML LF Party, PackageName, PackageId fromString error messages (#5855)
* Add description to daml.lf.data.StringModule implementations

Make sure DAML LF Party deserialization picks up the added description.

changelog_begin
changelog_end

* addressing code review comments. @S11001001, thanks.
2020-05-06 10:02:49 -04:00
Robert Autenrieth
7e448d810c
Always use the latest ledger config (#5669)
CHANGELOG_BEGIN
- [Sandbox] The ledger API server will now always use the most recent ledger configuration.
  Until a ledger configuration is read from the ledger, command submissions will fail with the UNAVAILABLE error.
CHANGELOG_END

In kvutils, the first ledger configuration change needs
to have a generation one higher than the one returned
by getLedgerInitialConditions().

Remove initial config writing from sandbox as it's now written by the ledger API server
2020-05-06 12:12:23 +02:00
Stefano Baghino
df12c529c8
Fix broken migration v25 with v29 (#5861)
The v25 migration did not read transactions in order, causing #5659.

This PR re-arranges migrations so that ledger_entries can be re-read to fix the issue before dropping it in v30 (which used to be v29).

Fixes #5659.

changelog_begin
[Sandbox Classic] There is a chance that migrating from Sandbox 0.13.55 to Sandbox Classic 1.0.0 could have
introduced contracts falsely reported as active when in fact they are not. Migrating to Sandbox Classic
1.1.0 will fix the issue. For more details, see #5659.
changelog_end
2020-05-06 10:08:32 +00:00
Gerolf Seitz
4d606689bb
Centralize metric names (#5790)
Centralizing the metrics allows us to have a good overview of the
existing metrics.

CHANGELOG_BEGIN
CHANGELOG_END
2020-05-05 16:55:29 +02:00
Stephen Compall
2b23b41391
JSON decoding support for GenMap (#5223)
* add GenMap to the "all types" test generators

* report bad GenMap format with DeserializationError, not MatchError

* document GenMap JSON

* notes on missing features

* enable -Xsource:2.13 in transaction

* make an Order instance for Value resolvable, but unimplemented

* use the skeleton from SValue ordering to make a Value ordering skeleton

* add Party Order

* add Order instance for SortedLookupList

* add Order for FrontStack, deriving everything

* factor the Order lookup, and tie a knot in the recursive Value instances

* we're going to need this Iterator thing again

* replacing Order#contramap with version that supports equalIsNatural

* use new equalBy, orderBy for FrontStack, SortedLookupList, ImmArray

* _2 comparator, upgrade Name Equal to an Order

* incorporate lookup for enums, variants into Value order; record/struct cases

* Enum/Variant comparison

* looking up the singleton implicitly won't work for non-`object`s, alas

* test Order laws for values of all primitive types

* test Order laws for record and variant types

* test Order laws for enum types

* test that enum strings are not compared

* use checkLaws for Value Equal as well

* test that enums match order to constructor rank

* factor genAddend and genAddendNoListMap

* reintroduce Order for TypedValueGenerators

* more addend order

* record, variant order cases

* record cons order

* deriving Order while decoding from JSON

* make ApiCodecCompressed's Cid codec based on the typeclass

* test how the Value ordering and the underlying projected value orderings line up

- hint: they don't, yet
- this is also a template for how we'll check the fidelity with SValue
  ordering

* test how the Value ordering and SValue ordering line up

- hint: they don't, yet

* typed Arbitrarys have access to Order

* produce proper ValueGenMap

* inj requires Order, sometimes

- we encode this as "all the time" but there is a type-level unification
  approach to remove this requirement in some cases

* make inj a function

* test that order doesn't matter for JSON decoder

* use Utf8 order for TVG text; don't pretend that base equal works

* sort JSON GenMaps, and check for duplicates

* make injarb use IntroCtx

* remove stray import

* Order instances for Bytes, Hash, AbsoluteContractId

* require Order[Cid] to decode JSON to LF values

* clean up map reordering test

* remove unused Instant instance

* fake Order instance no longer needed, valid instance defined

* test parity of global AbsoluteContractId order and SContractId order

* bazel fmt

* test AbsoluteContractId Order lawfulness

* test duplicate key detection

CHANGELOG_BEGIN
- [JSON API] Prepare full support for the planned GenMap primitive type.
  See `issue #5031 <https://github.com/digital-asset/daml/issues/5031>`_.
CHANGELOG_END
2020-05-05 10:27:37 -04:00
Oliver Seeliger
4c0ffdf4df
Upgrade scala compiler silencer to 1.6.0 (#5822)
* Upgrade scala compiler silencer to 1.6.0

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt build bazel file to new targets

* Switch to silencer plugin scala 2.12.11 per Samir's feedback

rather than 2.12.8

* Add missed bazel files

* Review feedback from Leo
2020-05-04 21:30:46 +00:00
Stefano Baghino
89eb6c64d2
Integrate PostCommitValidation with JdbcLedgerDao and SqlLedger (#5781)
* Integrate PostCommitValidation with JdbcLedgerDao and SqlLedger

Closes #5035
Closes #5663

changelog_begin
[Sandbox] Skip unnecessary double post-commit validation inherited by sandbox-classic, expect performance improvement
changelog_end

* Ensure SqlLedger recovers from failures and logs them when publishing a transaction

* Remove unused import

* Remove tests for ledger entries

* Fix completions test to make them compile

* Fix compilation errors in tests, address self-review items, apply necessary fixes

- address https://github.com/digital-asset/daml/pull/5781#pullrequestreview-403293667
- address https://github.com/digital-asset/daml/pull/5781#pullrequestreview-403378192

* Pass TransactionTimeModelComplianceIT

* Minor tweaks to variable naming

* Fix failing tests

* Stop deduplicating commands on failures

* Attempt at making sandbox-classic allocate parties implicitly

* Remove implicit party allocation test (without full server) for SQL backed sandbox-classic

* Removing ImplicitPartyAdditionIT (covered in conformance tests)

* Add migrations

* Fix test for ledger DAO with post-commit validation against PostgreSQL

* Update PostgresIT

* Fix missing/wrong items from previous commits

* Don't perform batch processing of enqueued persistence entries

* Rebase against master
2020-05-04 15:28:18 +00:00
Gerolf Seitz
0a7575de85
Sandbox: expose back pressure config in CLI (#5820)
* Sandbox: expose back pressure config in CLI

CHANGELOG_BEGIN
[Sandbox]: Added ``--max-commands-in-flight`` as CLI configs. See ``daml sandbox --help``.
[Sandbox Classic]: Added ``--max-commands-in-flight`` and
``--max-parallel-submissions`` as CLI configs. See ``daml sandbox-classic --help``.
CHANGELOG_END

* Bumping the default maxParallelSubmissions to 512 for sandbox classic
We used to use `maxCommandsInFlight * 2` in SqlServer, but it makes more
sense to use `maxParallelSubmissions` there. Since the lower default value of 128
would result in the conformance tests to fail, I'm bumping it to 512

* Use maxCommandsInFlight to configure the parallel submissions for CommandService
2020-05-04 15:24:49 +02:00
simonmaxen-da
a8d97c9ec0
Add a reason text field to RejectReason.Inconsistent (#5180) (#5815)
* Add a reason text field to RejectReason.Inconsistent (#5180)

CHANGELOG_BEGIN

	- Add a reason text field to RejectReason.Inconsistent.
  See `#5810 <https://github.com/digital-asset/daml/issues/5810>`__.

CHANGELOG_END

* Change wording in contributing instructions to reflect best practice (#5820)

* Also make add reason text to other reject reasons that don't have it (#5820)

* Update with review comments (#5820)

* Update with review comments (#5820)

* Update with review comments (#5820)
2020-05-04 12:54:17 +01:00
Robert Autenrieth
9252515f4a
Increase wait time in deduplication tests (#5813)
Deduplication is unreliable around the end
of the deduplication window.

CHANGELOG_BEGIN
CHENGELOG_END
2020-05-04 13:13:08 +02:00
Leonid Shlyapnikov
51d96a7d2e
Upgrading to scalac/runtime v2.12.11, we have been on v2.12.6 for too long (#5807)
https://github.com/scala/scala/releases/tag/v2.12.11

Fixing scalac deprecation and unused variable warnings

`/:` is deprecated, using foldLeft
`:\` is deprecated, using foldRight

Removing unused deps reported by bazel buildozer + scalafmt

changelog_begin
Upgraded Scala compiler and Scala runtime to v2.12.11.
See https://github.com/scala/scala/releases/tag/v2.12.11
changelog_end
2020-05-01 11:37:07 -04:00
Gerolf Seitz
e821168909
Reset service improvements for sadbonx (#5728)
- Only upload packages during the initial startup.
- Avoid loading packages during subsequent resets
- Share an engine between Ledger API Server and Committer

* Use a randomized H2 URL to simular in-memory

The reset service test assumes to get a completely new ledger for each
test case. But because we use H2 in-memory with db_close_delay=1 and the
same H2 database name, the second test case gets the remnants of the
first test case.

Since we know that sandbox in-memory uses an H2 in-memory URL, we can
simply use SandboxBackend.H2Database for ResetServiceInMemoryIT.

CHANGELOG_BEGIN
[Sandbox] Drastically lower the time needed to do a reset via the
ResetService.
CHANGELOG_END
2020-04-30 17:06:21 +02:00
Samir Talwar
0ae62b50e4
sandbox: Mark the ResetService tests as flaky. (#5778) 2020-04-29 15:17:45 +02:00
Stefano Baghino
c709f91a73
Adjust PostCommitValidation (#5774)
* Adjust PostCommitValidation

- do not require a party for validation (to validate divulged contracts)
- stop validation after first error and don't accumulate rejection reasons
- address 01da7393b3 (r416719399)

changelog_begin
changelog_end

* Use participant state rejection reasons, drop unused submitter parameter from validation
2020-04-29 12:55:16 +00:00
Stefano Baghino
f71ab92ea5
Implement replacement for post-commit validation (#5737)
* Implement replacement for post-commit validation

PostCommitValidation is meant as a replacement for ActiveLedgerState and
ActiveLedgerStateManager for JdbcLedgerDao so that the old table can eventually
be retired and post-commit validation can happen on the new participant schema.

This commit simply introduces the implementation and tests it in isolation.

Integration with the existing system will come in a separate contribution.

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/5737#discussion_r415918949

* Address https://github.com/digital-asset/daml/pull/5737#discussion_r415921207

* Add tests for the empty ledger scenario and introduce necessary fixes

* Add more tests for fetch and using some prior history

* Add tests for divulged contracts
2020-04-28 18:53:52 +02:00
Samir Talwar
c1e1ee4d4b
Sandbox: Split LedgerApiServer up a little. (#5758)
* sandbox: Split up LedgerApiServer.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Extract out API service construction from LedgerApiServer.

* sandbox: Pull out a case class for GrpcServerOwner event loop params.

* sandbox: Split ownership of `ApiServices` from the object.
2020-04-28 15:44:31 +00:00
Miklos
d6c5a2532d
Add counting future metrics (#5743)
* Added counting metrics.

* Code tidying.
CHANGELOG_BEGIN
CHANGELOG_END

* Rename based on review suggestion.
2020-04-28 13:58:15 +00:00
mziolekda
bbd21605f5
add readme that details the usage of integrity check tool (#5685)
* add readme that details the usage of integrity check tool

* Apply suggestions from code review

Addressing review comments

Co-Authored-By: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-04-28 09:18:35 +02:00
Gerolf Seitz
690092e066
Sandbox: Properly respect --log-level parameter (#5717)
In #5419 we set specific loggers to WARN or ERROR so that we avoid noisy
logging by default.  However, if the user specifies the --log-level CLI
param, not only the root logger, but also other loggers set in logback.xml
should log at that level.

CHANGELOG_BEGIN
[Sandbox] Properly respect the --log-level CLI parameter
CHANGELOG_END
2020-04-27 08:24:21 +02:00
Robert Autenrieth
49c6a20f0a
Remove duplicate ledger time field (#5698)
The duplicated information was not always in sync.

Fixes #5662

CHANGELOG_BEGIN
- [Sandbox] Fix an issue where the sandbox would sometimes reject transactions
  with a "INVALID_ARGUMENT: Disputed" error if either of
  ``min_ledger_time_rel`` or ``min_ledger_time_abs`` was set in the
  submission request.
CHANGELOG_END
2020-04-24 10:02:26 +02:00
Stefano Baghino
bed58c7e12
Avoid instantiating new implicit conversions for every query (#5706)
* Avoid instantiating new implicit conversion for every query

changelog_begin
changelog_end

* Make HashToStatement an object as well

* Address https://github.com/digital-asset/daml/pull/5706#discussion_r413896788
2020-04-23 16:55:58 +00:00
Remy
15354c3256
DAML-LF: remove submitter is in maintainer check (#5611)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 16:10:39 +02:00
Stefano Baghino
06d4451e8b
Fix hashing of keys in the new contract store (#5681)
* Fix hashing of keys in the new contract store

Use GlobalKey.hash instead of KeyHasher.hashKey

Fixes #5680

changelog_begin
changelog_end

* Fix order of fields in migration

* Fix migration naming

* Rename file according to class

* Fix hash of active contracts, not consumed ones
2020-04-23 14:24:37 +02:00
Stefano Baghino
c66d89dab8
Fix flakiness of GroupContinuous test (#5696)
Fixes #5690

changelog_begin
changelog_end
2020-04-23 11:37:15 +00:00
Samir Talwar
77af35f44e
ledger-on-sql: Name the RangeSource parameters more explicitly. (#5679)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-23 09:10:16 +00:00
Gerolf Seitz
48fd1e47a0
kvutils: fix validation of false negative key lookups (#5608)
* Make the contract keys test fail if the transaction is not rejected by the committer

- First, this removes the assert statement in the DAML model, so that the
  transaction validation doesn't fail with a transaction abort.
- Second, the gRPC error message should contain Disputed. `InvalidLookup`
  should only be used in Sandbox Classic, but due to code sharing, the
  validation that triggers this error is also run for Sadbonx.

* Fix the key lookup in kvutils

The current way of transaction validation and key lookup does not work
in the following scenario:
- the transaction coming from the participant has a negative key lookup
- the contract key state is loaded, which points to a contract that has
  been created by another transaction since the command interpretation
  on the participant
- the contract state for the contractId inside the contract key state
  has not been loaded, therefore the visibility and activeness check in
  `ProcessTransactionSubmission.lookupKey` returns `None`, even though
  there is in fact a contract with such a key.

To mitigate this issue, the `lookupKey` function must not check
activeness or visibility. If the submitter is not allowed to load the
contract via a key lookup, the authorization check should catch that.
Any other situation that is inconsistent should result in a rejection of
the transaction.

A small side effect of this change is that the `lookupContract` function
might try to load a contract that wasn't loaded from the kv state
earlier. This only happens because we first rebuild the entire
transaction before we compare it to the original transaction.
Previously we threw an exception in this case, but this results in a rather
ugly abort of the reinterpretation of the transaction. Therefore the
`lookupContract` function just returns `None`. Eventually the
transaction will be rejected during validation of the nodes, because
the `LookupByKey` nodes will be different.
This would not happen if we reinterpreted the transaction lazily and
compared the nodes as soon as they are produced with the corresponding
node of the original transaction.

CHANGELOG_BEGIN
[kvutils] Fixed the validation of key lookups.
See issue `#5562 <https://github.com/digital-asset/daml/issues/5562>`__.
[Participant Server, Ledger API Test Tool] Use rejection reasons of the participant-state API instead of sandbox specific ones.
CHANGELOG_END

* Validate causal monotonicity of used contract keys

When using LookupByKey, the return contract isn't necessarily fetched or used
any other way. This means that we need an extra pass over all contract keys to
ensure that causal monotonicity is respected. To be able to do this,
there is now a new field `DamlContractKeyState.active_at`, which is set to the
same value `DamlTransactionEntry.ledger_effective_time`.
An additional check in `ProcessTransactionSubmission` uses this field to verify
causal monotonicity.
2020-04-23 09:44:39 +02:00
fabiotudone-da
94e7330628
Let BenchmarkReporter create a file if it doesn't exist (#5657)
CHANGELOG_BEGIN
[TestTool] Let `--perf-tests-report` attempt to create the file if it doesn't exist
CHANGELOG_END
2020-04-22 09:28:03 +02:00
Stefano Baghino
70a8e8103c
Make sure failed LET lookups don't throw on the DB threads (#5655)
This could lead to slow rollbacks that could cascade on errors that
pile up and keep precious DB threads busy for longer than needed.

changelog_begin
changelog_end
2020-04-22 09:05:09 +02:00
Robert Autenrieth
1128833ab5
Write a config on startup (#5591)
* Write a config on startup

CHANGELOG_BEGIN
CHANGELOG_END

* Rename things

* Make the initial ledger config configurable

* Demote log level for unsupported config writes

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/apiserver/services/admin/ApiConfigManagementService.scala

Co-Authored-By: Miklos <57664299+miklos-da@users.noreply.github.com>

* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/configuration/LedgerConfiguration.scala

Co-Authored-By: Miklos <57664299+miklos-da@users.noreply.github.com>

* Move code around

* Delay config submissions on kvutils ledgers

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
2020-04-21 20:35:42 +00:00
Remy
0353408c01
Ledger: Add nodeSeeds and byKeyNodes to participant state (#5602)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-21 19:00:50 +02:00
fabiotudone-da
5210b99531
Remove unused performance test DAML sources (#5652)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-21 17:13:30 +02:00
Stefano Baghino
6f04870e2d
Ensure the contract store deals correctly with divulged transient contracts (#5647)
Fixes #5646

Empty changelog because the bug did not make it into a release.

changelog_begin
changelog_end
2020-04-21 15:02:45 +00:00
Stefano Baghino
bb0e8038cc
Create single-party specialized queries to access events (#5626)
* Create single-party specialized queries to access events

Closes #5620

changelog_begin
changelog_end

* Ensure ordering of events when performing a lookup
2020-04-20 14:10:34 +00:00
Stefano Baghino
ec4c86d856
Clean up events table (#5622)
- removes unused `is_root` column, closes #5618
- merges `template_package_id` and `template_name` in `template_id`, closes #5619

changelog_begin
[Ledger API] clean up of the participant index, improved performance when requesting transactions by template
changelog_end
2020-04-20 11:39:03 +02:00
Stefano Baghino
f81efb3d9d
Add new participant schema contracts table (#5541)
* Add new participant schema contracts table

- full implementation (both read and write path)
- fixes #5514

changelog_begin
[Ledger API Server] Fixed a bug that prevented validating transactions
containing reference to contracts that did not originate on the local
participant. See `issue #5514 <https://github.com/digital-asset/daml/issues/5514>`_.
changelog_end

* Format fixes and addressing comments

- address https://github.com/digital-asset/daml/pull/5541#discussion_r408806775
- address https://github.com/digital-asset/daml/pull/5541#discussion_r408806964
- address https://github.com/digital-asset/daml/pull/5541#discussion_r408812745

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r408815185

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r408813067

* Fix mistake in comment

* Apply suggestions from code review

Co-Authored-By: Gerolf Seitz <gerolf.seitz@daml.com>

* Fix compilation error

* Add data migration

Tested by https://github.com/stefanobaghino-da/test-5541-data-migration

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r409386378

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r409385174

* Address https://github.com/digital-asset/daml/pull/5541#discussion_r409367606

* Simplify migration

* Address review

- address https://github.com/digital-asset/daml/pull/5541#discussion_r410344423
- address https://github.com/digital-asset/daml/pull/5541#discussion_r410339914

* Update ledger/sandbox/src/main/resources/db/migration/postgres/V26_0__Contracts_new_schema.sql

Co-Authored-By: Gerolf Seitz <gerolf.seitz@daml.com>

* Fix migration for privacy-aware ledgers

* Remove leftover query

* Fix migration hashes

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-04-17 20:07:20 +00:00
Samir Talwar
7d094fac2b
kvutils: Don't report ledger metrics by default. (#5604)
Instead, opt-in explicitly in _ledger-on-memory_ and _ledger-on-sql_.

Wrapping the operations can confuse other users of `LedgerStateAccess`.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-17 14:16:02 +00:00
Remy
a178e3e3e9
DAML-LF: remove seed from node, move it to transaction meta data. (#5570)
* DAML-LF: remove seed from node, move it to transaction meta data.

+ redesign seeding to validate partial transaction.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-17 11:02:11 +02:00
Samir Talwar
21ee16623e
sandbox: Revert execution metric paths. (#5588)
Some customers rely on these.

CHANGELOG_BEGIN
- [Ledger API Server] Moved the ``daml.commands.execution`` back to
  ``daml.execution``.
CHANGELOG_END
2020-04-16 18:30:29 +00:00
Samir Talwar
e854191586
kvutils: Add a timing metric for the commit. (#5589)
CHANGELOG_BEGIN
- [Ledger Integration Kit] Added a timing metric for the commit at
  ``daml.kvutils.writer.commit``.
CHANGELOG_END
2020-04-16 18:30:09 +00:00
Samir Talwar
6a1b8a337f
ledger-api-common: Add a metric for command validation upon submission. (#5585)
* ledger-api-common: Add a metric for command submission validation.

CHANGELOG_BEGIN
- [Ledger API Server] Add a metric for command validation upon
  submission, ``daml.commands.validation``.
CHANGELOG_END

* ledger-api-common: Move the submissions metric from sandbox.
2020-04-16 16:46:16 +00:00
Samir Talwar
02eadf68c8
sandbox: Moar command submission metrics. (#5583)
* sandbox: Add a test for MetricsInterceptor for non-streaming endpoints.

* sandbox: Simplify MetricsInterceptor by overriding `ServerCall`.

* sandbox: Time all submissions, not just through the submission service.

* sandbox: Don't bother timing transaction submissions twice.

They're already timed by TimedWriteService.

* sandbox: Move command submission metrics to "daml.commands".

CHANGELOG_BEGIN
- [Ledger API Server] A number of command submission metrics have moved,
  and we have added a couple.
  - ``daml.commands.submissions`` is a new timer that measures all
    submissions.
  - ``daml.commands.valid_submissions`` is a new meter that counts
    valid (unique, interpretable) submissions.
  - ``daml.lapi.command_submission_service.failed_command_interpretations``
    has been moved to ``daml.commands.failed_command_interpretations``.
  - ``daml.lapi.command_submission_service.deduplicated_commands`` has
    been moved to ``daml.commands.deduplicated_commands``.
  - ``daml.lapi.command_submission_service.delayed_submissions`` has
    been moved to ``daml.commands.delayed_submissions``.
  - ``daml.lapi.command_submission_service.submitted_transactions`` has
    been moved to ``daml.services.write.submit_transaction``.
  - All ``daml.execution.*`` metrics have moved to
    ``daml.commands.execution``.
CHANGELOG_END

* metrics: Update the dashboard to include the new command metrics.
2020-04-16 15:20:39 +00:00
Remy
9704a39bae
Engine: refactor PartialTransaction context (#5578)
* Engine: refactor PartialTransaction context

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-16 14:39:12 +02:00
Robert Autenrieth
fe29cfbbb9
Delay submissions of transactions with future time (#5556)
* Add time provider type to ledger API server

Static time sometimes needs special treatment

* Delay submissions of transactions with future time

Fixes #5480.

CHANGELOG_BEGIN
- [Sandbox] The sandbox now properly delays command submissions using
   minLedgerTimeAbs or minLedgerTimeRel. See
  `issue #5480 <https://github.com/digital-asset/daml/issues/5480>`_.
CHANGELOG_END
2020-04-16 13:20:11 +02:00