mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
be35f3a31f
This PR creates 3 validation modes: * `Strict`: Specifies that the committer should validate the package before committing them to the ledger. When using this mode, the packages committed to the ledger can be fully trusted and do not have to be validated when loaded into the engine. * `Lenient`: Specifies that the committer should perform a fast validation of the packages before committing them to the ledger. This mode is useful for ledger integrations that cannot handle long-running submissions (> 10s). When using this mode, the packages committed to the ledger cannot be trusted and must be validated every time they are loaded into the engine. * `No`: Specifies that the committer should not perform any validation the packages before committing them to the ledger. This should be used only by non distributed ledgers, like DAML-on-SQL, where the validation done in the API server can be trusted. This PR creates 3 preloading modes: * `Synchronous` : Specifies that the packages should be preloading into the engine before committed. * `Asynchronous`: Specifies that the packages should be preloaded into the engine asynchronously with the rest of the commit process. This mode is useful for ledger integrations that cannot handle long-running submissions (> 10s). Failure of the preloading process will not affect the commit. * `No`: Specifies that the packages should not be preloaded into the engine. CHANGELOG_BEGIN - [Integration Kit] In kvutils, add metric daml.kvutils.committer.package_upload.validate_timer to track package validation time. CHANGELOG_END
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
load(
|
|
"//bazel_tools:scala.bzl",
|
|
"da_scala_library",
|
|
"da_scala_test",
|
|
"lf_scalacopts",
|
|
)
|
|
|
|
da_scala_library(
|
|
name = "validation",
|
|
srcs = glob(["src/main/**/*.scala"]),
|
|
scalacopts = lf_scalacopts,
|
|
tags = ["maven_coordinates=com.daml:daml-lf-validation:__VERSION__"],
|
|
visibility = [
|
|
"//compiler/scenario-service:__subpackages__",
|
|
"//daml-lf:__subpackages__",
|
|
],
|
|
deps = [
|
|
"//daml-lf/data",
|
|
"//daml-lf/language",
|
|
"//daml-lf/transaction",
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
|
],
|
|
)
|
|
|
|
da_scala_test(
|
|
name = "validation-test",
|
|
size = "small",
|
|
srcs = glob(["src/test/**/*.scala"]),
|
|
scalacopts = lf_scalacopts,
|
|
deps = [
|
|
":validation",
|
|
"//daml-lf/data",
|
|
"//daml-lf/language",
|
|
"//daml-lf/parser",
|
|
"@maven//:org_scalaz_scalaz_core_2_12",
|
|
],
|
|
)
|