* caching: Split caches into new files.
* caching: Rename `Cache.from` to `WeightedCache.from`.
* caching: Move `Configuration` inside `WeightedCache`.
* caching: Add test cases.
* caching: Allow for Caffeine builders to be covariant.
* caching: When instrumenting the Caffeine cache, compose, don't inherit.
* caching: Add a size-based cache.
* caching: Extract out common test cases into base classes.
* caching: Use the size-based cache for LF value translation.
CHANGELOG_BEGIN
CHANGELOG_END
* caching: Simplify the eviction tests.
* caching: Increase the encapsulation in CaffeineCache.
* caching: Commas are important.
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Do not expect a specific source location in ledger-api-test-tool
This broke running the ledger-api-test-tool against older ledgers
since the behavior of Speedy has changed slightly.
This PR changes `assertGrpcError` to accept a regex and uses that to
match for a wildcard in place of a specific location. I’ve gone
through the existing calls and added appropriate levels of escaping.
changelog_begin
changelog_end
* Pass an Option[Pattern] to avoid having to convert back to a String
changelog_begin
changelog_end
This is another refactoring extracted from #6314. This is removing the
`LedgerSession` argument from `LedgerTestSuite`. The goal of this change
is to remove the closures from the `Tests.Tests` type, so it becomes a
plain map of name to test suite, rather than a map of name to
function-that-returns-a-test-suite.
In context, this is another step towards removing the name duplication
that occurs in the `Tests.default` and `Tests.optional` maps. I have
separated this step from the one that actually removes the duplication
because removing the duplication in #6314 was done by turning the maps
into seqs, thereby changing the order in which tests are run, which
caused the flakiness issues I've been investigating over the past week.
This commit does not yet change the order in which tests are run and is
therefore safe from that perspective. It's still a true refactoring.
It's a fairly simple one at that as `LedgerTestSuite` itself never uses
the session, and there was only one subclass that did. The subclass,
`TransactionScaleIT`, only used it to get at one config parameter. In
this PR, that config parameter is instead passed down directly to the
`Tests.default` method.
The other use of the `session` attribute was to extract it from the test
suite in order to pass it to the `run` method of
`LedgerTestSuiteRunner`. This was done right after creating the test
suites and giving them that same session, so we're now skipping that
round trip and just giving the session directly to `run`.
CHANGELOG_BEGIN
CHANGELOG_END
In this PR we cleanup the constructor for the speedy Machine.
* We remove the `case` keyword since `Machine` is a stateful class,
* We replace the pre-existing builders with
+ one generic builder `Machine.apply`,
+ scenario specific builder,
CHANGELOG_BEGIN
CHANGELOG_END
This is extracted from #6314. This is a simple renaming of a few
classes. The goal here is to have the `LedgerTestSuite#name` match the
key currently used in the `Tests.default` and `Tests.optional` maps so
that we can eventually remove that duplication (after the
`LedgerSession` argument is removed so we can actually construct the
`LedgerTestSuite` objects and ask them their name).
Note that `LedgerTestSuite#name` is [already defined][0] as:
```
val name: String = getClass.getSimpleName
```
In the context of #6314, this is useful to align the existing behaviour
of `--include` with the desired future behaviour of `--exclude`, so we
can use the same names in both. Alternatives could be to remove the
`LedgerTestSuite#name` method and thread the key `String`s through to
the individual tests somehow, or make the `name` field a constructor
argument rather than reconstruct it based on the class name. This
approach of using the class name is the cleanest I could think of.
CHANGELOG_BEGIN
CHANGELOG_END
[0]: d01715bf2f/ledger/ledger-api-test-tool/src/main/scala/com/daml/ledger/api/testtool/infrastructure/LedgerTestSuite.scala (L14)
This is extracted from #6314, but actually has nothing to do with it.
This is removing two functions that are never called, as well as a type
that is never constructed (and the one pattern match on it).
CHANGELOG_BEGIN
CHANGELOG_END
* LF: rename library transaction-scalacheck to transaction-test-lib
CHANGELOG_BEGIN
CHANGELOG_END
* move files in com/daml
* missing change in release/artifacts.yaml
* remove 'com/dam' from the path
* Added minor logging to scala command client
Before, the scala command client did not log anything when a command was
leaving the application. Now, we get a small debug message that logs the
command id, which is going to be helpful for debugging and tracing
purposes.
CHANGELOG_BEGIN
CHANGELOG_END
* Addressed reviewer comments
* Fixed formatting
Let's not break others' code until they've had a chance to migrate.
This changes `LedgerIdRequirement` so that properties don't change
types, and adds `@deprecated` where necessary.
There is one behavior change: `ledgerId` used to return whatever string
was passed in (typically `""`) if the requirement was not enabled. It
now throws an exception.
In the future, we will change the type of `ledgerId` to be
`Option[String]`, and make `optionalLedgerId` an alias for that
property.
CHANGELOG_BEGIN
CHANGELOG_END
* ledger-api-client: Clarify LedgerIdRequirementTest names.
* ledger-api-client: Re-add the old `LedgerApiRequirement#copy` behavior.
This is used by some users; we don't want to break their code if we can
help it.
CHANGELOG_BEGIN
- [Ledger API Client] The signature of `LedgerApiRequirement` has
changed slightly. The old signature is now deprecated.
CHANGELOG_END
* ledger-api-client: Test deprecated LedgerApiRequirement behavior.
* Add option based constructor for LedgerIdRequirement
changelog_begin
changelog_end
* Make option based consructor the default, deprecate old constructor
* Update with review comments
* Add CLI option for ledger time skew
CHANGELOG_BEGIN
- [sandbox] Added a CLI option for specifying the initial ledger time model
CHANGELOG_END
* scalafmt
* reduce complexity from quadratic to linear
* output node in creating order
* avoid useless allocation of GenTransaction
* make it clearer
CHANGELOG_BEGIN
CHANGELOG_END
We split the object com.daml.lf.types.ledger in three:
- one part in `com.daml.lf.ledger.` (in //daml-lf/transaction) for the part relative to EventId (shares between scenario service and sandbox)
- one part in `com.daml.lf.ledger.` (in //daml-lf/interpreter) for the part common to Blinding and Scenario
- one part in `com.daml.lf.scenario.` (in //daml-lf/interpreter) for the part specific to Scenario
fixes#6260
CHANGELOG_BEGIN
CHANGELOG_END
* sandbox: Wait for a database to be available instead of crashing immediately on startup.
changelog_begin
[Sandbox] Wait for a database to be available instead of crashing
immediately on startup.
changelog_end
* Introduce CLI option for input buffer size
Also improves CLI help text for other back-pressure related options.
changelog_begin
[Sandbox] Allow to configure --input-buffer-size, which allows to tune the number of commands waiting to be submitted before the Sandbox applies back-pressure, run daml sandbox --help for more info.
changelog_end
* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/sandbox/cli/Cli.scala
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* events denormalization, WIP
* too soon to drop
* migration script
* add generated sha256 digest
* fixing the migration script naming
has to be double undescore after the version number
* flat event table queries
* write witnesses to events table during insert; disable inserts to witnesses tables
* use varchar[] for new witness columns instead of text[]
* ::varchar[] cast
* remove event witnesses table support code
* lookupFlatTransactionById works for postgres
* lookupTransactionTreeById works with postgres
* fixing the queries, replacing @> with &&
* cleanup
* multi-party postgres queries, WIP
* fixing multi-party queries, thanks @stefano.baghino
* fixing wildcardParties query
* minor cleanup
* h2 schema changes, h2 queries is WIP
* inlining some constants
* SqlFunctions introduced
* reformat
* Adding `SqlFunctions.arrayIntersectionValues`
* Adding `SqlFunctions.arrayIntersectionValues`
* Removing truncates for deleted tables
* Removing truncates for deleted tables
* filtering tree_event_witnesses
Co-authored-by: Stephen Compall <stephen.compall@daml.com>
* replace NodeExercises#controllers with controllersDifferFromActors
* remove controllers from ActorMismatch and scenario service exercise
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* remove reserved ID #s in scenario-service grpc
As discussed, we don't need to worry about
version mismatches.
Co-authored-by: Remy <remy.haemmerle@daml.com>
* Moved caching related classes to under validator.caching package.
* Introduced CacheUpdatePolicy for controlling what type of state keys should be updated in the cache and when.
* Consistently use 'cache update policy'.
CHANGELOG_BEGIN
CHANGELOG_END
* Made it explicit what policy we are testing against.
* Making `PaginatingAsyncStream.streamFrom` more generic
so it does not specify what exactly `Offset` is.
changelog_begin
changelog_end
* Addressing code review comments + cleanup
* Add additional metrics when storing transactions
Since event witnesses will soon be denormalized into the participant_events
table, I did not include metrics right now.
CHANGELOG_BEGIN
[DAML Ledger Integration Kit] Add additional metrics for storing transactions. The overall time is measured by ``daml.index.db.store_ledger_entry``.
- Timer ``daml.index.db.store_ledger_entry.prepare_batches``: measures the time for preparing batch insert/delete statements
- Timer ``daml.index.db.store_ledger_entry.events_batch``: measures the time for inserting events
- Timer ``daml.index.db.store_ledger_entry.delete_contract_witnesses_batch``: measures the time for deleting contract witnesses
- Timer ``daml.index.db.store_ledger_entry.delete_contracts_batch``: measures the time for deleting contracts
- Timer ``daml.index.db.store_ledger_entry.insert_contracts_batch``: measures the time for inserting contracts
- Timer ``daml.index.db.store_ledger_entry.insert_contract_witnesses_batch``: measures the time for inserting contract witnesses
- Timer ``daml.index.db.store_ledger_entry.insert_completion``: measures the time for inserting the completion
- Timer ``daml.index.db.store_ledger_entry.update_ledger_end``: measures the time for updating the ledger end
[Sandbox Classic] Added Timer ``daml.index.db.store_ledger_entry.commit_validation``: measure the time for commit validation in Sandbox Classic
CHANGELOG_END
* Refactoring: rename metrics *dao to *DbMetrics
* Experiment: replacing row OFFSET with ledger offset in the flat transactions query for one party.
if this improves the perf numbers, the rest of the queries can be updated.
* Flat transaction query optimization:
replacing row offset with ledger offset
* Flat transaction query optimization:
replacing row offset with ledger offset
* transaction tree query optimization
changelog_begin
[Sandbox-next/Postgres]
Flat Transaction Stream, Transaction Tree Stream SQL query optimizations.
Pagination based on Ledger Offset instead of SQL Row Offset.
changelog_end
* Addressing code review comments