daml/daml-lf/snapshot
Paul Brauner f4ee00361e
Make LF v2 non backwards-compatible with LF v1 in the compiler (#17492)
* initial commit

* split gen-stable-packages-v_i into two targets

* rename compatibleWith to canDependOn

* update damlc integration tests annotation to allow for 2.x

* use the right package ID for preconditionFailed when compiling to V2

* fuse stable-packages-v1 and stable-packages-v2 into one single filegroup

* Fix DA.Daml.LF.Ast.Tests

* remove leftover 'undefined' in Version.hs

* progress on fixing DataDependencies.hs

* fix Cross-SDK typeclasses test for 2.dev

* Fix the 'Typeclasses and instances' data dependency test

* Update comment

* fix //compiler/damlc/tests:packaging

* Add TODO

* parameterize the machine by the langage version, hardcode v1 in script v2, v2 in script v2, v1 in exports

* get EngineTests to pass

* fix more tests

* fix canton integration tests

* formatting

* fix more tests

* fix transactionversiontest

* fix exceptiontest

* Fix ValueEnricherSpec

* Fix EngineInfoTest

* fix PartialTransactionSpec

* fix upgragetest

* fix TransactionSnapshot

* Fix ContractKeySpec

* Fix ReinterpretTest

* fix InterfaceViewSpec

* fix InterfacesTest

* fix stable package v1 names

* fix validate.sh tests

* formatting

* Fix ChoiceAuthorityTest

* fix explicit disclosure test

* Fix SpeedyTest

* formatting

* Fix integration test

* fix data dependency tests

* fix package vetting count, increased due to metadata being added

* Redact stable package IDs in error messages in order for the ExceptionSemantics test to work for both v1 and v2

* cleanup

* fix Daml2ScriptTestRunner

* fix JsonApiIT and daml-script golden tests

* fix daml3-script runner test

* enable v2 for all integration tests

* formatting

* fix NodeSeedsTest

* fix since-lf annotations

* add comments, improve consistency

* stop hardcoding V1 in runPureExpr and runPureSExpr

* formatting

* remove harcoding of LFv1 in ConcurrentCompiledPackages.apply

* Parameterize Compiler.Config.Default with major language version

* remove global parser implicit and default package ID and language version
2023-10-11 11:40:17 +02:00
..
src Make LF v2 non backwards-compatible with LF v1 in the compiler (#17492) 2023-10-11 11:40:17 +02:00
BUILD.bazel bump copyright (#16002) 2023-01-04 18:21:15 +01:00
README.md Remove kvutils buf configuration and other leftovers [KVL-1427] (#13732) 2022-04-28 16:00:23 +02:00

replay-benchmark

This benchmarks the LF engine using transactions from a ledger entries stored in a file.

Build

Build the tool with Bazel:

bazel build //daml-lf/snapshot:replay-benchmark

Running the tool

Run the tool using Bazel and pass the benchmark parameters using -p jmh command line functionality:

 bazel run //daml-lf/snapshot:replay-benchmark --   \
  -p entriesFile=<entries files>                    \
  -p choiceName=<exercise choice names>             \
  [-p choiceIndex=<index of the exercise node>]     \
  [-p darFile=<dar files>]                                              

where:

  • <entries files>: is the full path of the ledger entries files to be used separated by commas (,). At the time of writing, entries files can be created by the submission-entries-extractor residing in a private repository.

  • <exercise choice names>: is the full qualified choice name of the root exercise node to be benchmarked separated by commas (,). A full qualified choice name should be of the form ModuleName:TemplateName:ChoiceName. Note the package ID is omitted. By default, the tool benchmarks the first choice with such a name it finds in the ledger export.

  • the optional parameter <position of the exercise node> is the index of the exercise among the root exercise nodes that matches choice name specified by the choiceName parameter in the order they appear in the export.

  • the optional parameter <dar files> specify the full path of the dar files to be used separated by commas (,). If defined the program contained in the dar file is used instead of one present in the ledger export, and the export is "adapted" to this program. The adaptation process attempts to map the identifiers from the export file with the ones of dar file when those latter differ only in their package ID. This can be used when the original Daml source used to generate the ledger export is only slightly modified or compiled with different options.

replay-profile

This profiles the replay of a transaction built from a ledger entries file.

 bazel run //daml-lf/snapshot:replay-profile --     \
  --entries <entries files>                         \
  [--dar <dar files>]                               \
  --profile-dir <profile directory>                 \
  --choice <exercise choice names>                  \
  [--exercise-index <exercise index>]

where:

  • <entries files>: is the full path of the ledger entries files to be used separated by commas (,)

  • <exercise choice names>: is the full qualified choice name of the root exercise node to be benchmarked separated by commas (,). A full qualified choice name should be of the form ModuleName:TemplateName:ChoiceName. Note the package ID is omitted. By default, the tool benchmarks the first choice with such a name it finds in the ledger export.

  • the optional parameter <position of the exercise node> is the index of the exercise among the root exercise nodes that matches choice name specified by the choiceName parameter in the order they appear in the export.

  • the optional parameter <dar files> specify the full path of the dar files to be used separated by commas (,). If defined the program contained in the dar file is used instead of one present in the ledger export, and the export is "adapted" to this program. The adaptation process attempts to map the identifiers from the export file with the ones of dar file when those latter differ only in their package ID. This can be used when the original Daml source used to generate the ledger export is only slightly modified or compiled with different options.

  • <profile directory> is the directory where the profiling output will be written.