Skip to content

Commit 4cc7df9

Browse files
update canton to dc96c4ab (#20604)
* sync the code drop to canton dc96c4aba3ca2cb14bd3ca480cfe638646464486 * fix fmt.sh * fix pre-commit config * fix canton/BUILD.bazel
1 parent d2a4b4d commit 4cc7df9

File tree

993 files changed

+11216
-5763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

993 files changed

+11216
-5763
lines changed

Diff for: ci/copy-canton.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
set -euo pipefail
5+
6+
DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
7+
8+
if [ "$#" -ne 1 ]; then
9+
echo "Usage: $0 <canton_directory>"
10+
exit 1
11+
else
12+
canton_dir=$1
13+
fi
14+
15+
code_drop_dir=$DIR/../sdk/canton
16+
for path in community daml-common-staging README.md; do
17+
rm -rf $code_drop_dir/$path
18+
for f in $(git -C "$canton_dir" ls-files $path); do
19+
# we're only interested in copying files, not directories, as git-ls has
20+
# explicitly expanded all directories
21+
if [[ -f $canton_dir/$f ]]; then
22+
# we create the parent directories of f under canton/ if they don't exist
23+
mkdir -p $code_drop_dir/$(dirname $f)
24+
cp $canton_dir/$f $code_drop_dir/$f
25+
fi
26+
done
27+
git add $code_drop_dir/$path
28+
done

Diff for: sdk/.pre-commit-config.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
# See https://pre-commit.com for more information
55
# See https://pre-commit.com/hooks.html for more hooks
66

7-
exclude: '^canton/'
7+
exclude: '^sdk/canton/'
88
repos:
99
- repo: local
1010
hooks:
1111
- id: hlint
1212
name: hlint
1313
language: system
14-
entry: "hlint -j"
14+
entry: "hlint -j --hint=sdk/.hlint.yaml"
1515
require_serial: true
1616
types: [haskell]
1717
- id: scalafmt
1818
name: scalafmt
1919
language: system
2020
require_serial: true
21-
entry: "scalafmt -c sdk/.scalafmt.conf --respect-project-filters"
21+
entry: "scalafmt --config=sdk/.scalafmt.conf --respect-project-filters"
2222
types: [scala]
2323
- id: javafmt
2424
name: javafmt
@@ -30,19 +30,19 @@ repos:
3030
name: buildifier
3131
language: system
3232
require_serial: true
33-
entry: "bazel run //:buildifier-pre-commit -- -mode=fix -v=true"
33+
entry: "bash -c 'cd sdk/; bazel run //:buildifier-pre-commit -- -mode=fix -v=true'"
3434
types: [bazel]
3535
- id: pprettier
3636
name: pprettier
3737
language: system
3838
require_serial: true
3939
# NB: we need to pass a single argument which ends up in $0 when invoking bash -c
40-
entry: "bash -c 'yarn install --silent && yarn run pprettier --write \"$@\"' bash"
40+
entry: "bash -c 'yarn install --silent && files=(\"$@\") && yarn run --cwd=sdk pprettier --write ${files[@]##sdk/}' bash"
4141
types_or: [ts, tsx]
4242
- id: copyrights
4343
name: copyright headers
4444
description: Idempotently add DA copyright headers to source files.
4545
language: system
4646
pass_filenames: false
47-
entry: "dade-copyright-headers update"
47+
entry: "bash -c 'unset GIT_DIR; dade-copyright-headers update'"
4848
types: [text]

Diff for: sdk/canton/BUILD.bazel

+97-23
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ scala_library(
267267
],
268268
)
269269

270-
### community/common ###
270+
### community/base ###
271271

272272
proto_library(
273-
name = "community_common_proto",
274-
srcs = glob(["community/common/src/main/protobuf/**/*.proto"]),
275-
strip_import_prefix = "community/common/src/main/protobuf",
273+
name = "community_base_proto",
274+
srcs = glob(["community/base/src/main/protobuf/**/*.proto"]),
275+
strip_import_prefix = "community/base/src/main/protobuf",
276276
deps = [
277277
"@com_google_protobuf//:duration_proto",
278278
"@com_google_protobuf//:empty_proto",
@@ -284,8 +284,8 @@ proto_library(
284284
)
285285

286286
proto_gen(
287-
name = "community_common_proto_scala",
288-
srcs = [":community_common_proto"],
287+
name = "community_base_proto_scala",
288+
srcs = [":community_base_proto"],
289289
plugin_exec = "//scala-protoc-plugins/scalapb:protoc-gen-scalapb",
290290
plugin_name = "scalapb",
291291
plugin_options = [
@@ -295,11 +295,11 @@ proto_gen(
295295
)
296296

297297
scala_library(
298-
name = "community_common",
299-
srcs = glob(["community/common/src/main/scala/**/*.scala"]) + [":community_common_proto_scala"],
298+
name = "community_base",
299+
srcs = glob(["community/base/src/main/scala/**/*.scala"]) + [":community_base_proto_scala"],
300300
plugins = [kind_projector_plugin],
301-
resource_strip_prefix = "canton/community/common/src/main/resources",
302-
resources = glob(["community/common/src/main/resources/**"]),
301+
resource_strip_prefix = "/canton/community/base/src/main/resources",
302+
resources = glob(["community/base/src/main/resources/**"]),
303303
scalacopts = [
304304
"-Xsource:3",
305305
"-language:postfixOps",
@@ -313,16 +313,12 @@ scala_library(
313313
":pekko-stream-minus-patched-classes",
314314
"//canton:community_buildinfo",
315315
"//canton:community_ledger_ledger-common",
316-
"//canton:community_lib_Blake2b",
317316
"//canton:community_lib_slick_slick-fork",
318317
"//canton:community_lib_wartremover",
319318
"//canton:community_util-external",
320319
"//canton:community_util-logging",
321320
"//canton:daml-common-staging_daml-errors",
322-
"//daml-lf/archive:daml_lf_archive_reader",
323321
"//daml-lf/data",
324-
"//daml-lf/interpreter",
325-
"//daml-lf/language",
326322
"//daml-lf/transaction",
327323
"//daml-lf/transaction:transaction_proto_java",
328324
"//daml-lf/transaction:value_proto_java",
@@ -341,7 +337,6 @@ scala_library(
341337
"//libs-scala/rs-grpc-pekko",
342338
"//libs-scala/scala-utils",
343339
"//observability/metrics",
344-
"//observability/tracing",
345340
"@canton_maven//:org_flywaydb_flyway_core",
346341
"@maven//:ch_qos_logback_logback_classic",
347342
"@maven//:ch_qos_logback_logback_core",
@@ -350,7 +345,6 @@ scala_library(
350345
"@maven//:com_github_blemale_scaffeine_2_13",
351346
"@maven//:com_github_pathikrit_better_files_2_13",
352347
"@maven//:com_github_pureconfig_pureconfig_core_2_13",
353-
"@maven//:com_github_pureconfig_pureconfig_generic_2_13",
354348
"@maven//:com_google_crypto_tink_tink",
355349
"@maven//:com_google_guava_guava",
356350
"@maven//:com_google_protobuf_protobuf_java",
@@ -378,15 +372,91 @@ scala_library(
378372
"@maven//:io_opentelemetry_opentelemetry_api",
379373
"@maven//:io_opentelemetry_opentelemetry_context",
380374
"@maven//:io_scalaland_chimney_2_13",
381-
"@maven//:junit_junit",
382-
"@maven//:net_logstash_logback_logstash_logback_encoder",
383-
"@maven//:org_apache_logging_log4j_log4j_core",
384375
"@maven//:org_apache_pekko_pekko_actor_2_13",
385376
"@maven//:org_bouncycastle_bcpkix_jdk15on",
386377
"@maven//:org_bouncycastle_bcprov_jdk15on",
387378
"@maven//:org_postgresql_postgresql",
388379
"@maven//:org_scala_lang_modules_scala_collection_compat_2_13",
389380
"@maven//:org_scala_lang_modules_scala_collection_contrib_2_13",
381+
"@maven//:org_scalaz_scalaz_core_2_13",
382+
"@maven//:org_slf4j_slf4j_api",
383+
"@maven//:org_typelevel_cats_core_2_13",
384+
"@maven//:org_typelevel_cats_kernel_2_13",
385+
],
386+
)
387+
388+
### community/common ###
389+
390+
scala_library(
391+
name = "community_common",
392+
srcs = glob(["community/common/src/main/scala/**/*.scala"]),
393+
plugins = [kind_projector_plugin],
394+
resource_strip_prefix = "canton/community/common/src/main/resources",
395+
resources = glob(["community/common/src/main/resources/**"]),
396+
scalacopts = [
397+
"-Xsource:3",
398+
"-language:postfixOps",
399+
],
400+
unused_dependency_checker_mode = "error",
401+
runtime_deps = [
402+
# not used at compile time, but required by com.digitalasset.canton.util.PekkoUtil.createActorSystem
403+
"@maven//:org_apache_pekko_pekko_slf4j_2_13",
404+
],
405+
deps = [
406+
":pekko-stream-minus-patched-classes",
407+
"//canton:community_base",
408+
"//canton:community_buildinfo",
409+
"//canton:community_ledger_ledger-common",
410+
"//canton:community_lib_Blake2b",
411+
"//canton:community_lib_slick_slick-fork",
412+
"//canton:community_lib_wartremover",
413+
"//canton:community_util-external",
414+
"//canton:community_util-logging",
415+
"//canton:daml-common-staging_daml-errors",
416+
"//daml-lf/archive:daml_lf_archive_reader",
417+
"//daml-lf/data",
418+
"//daml-lf/interpreter",
419+
"//daml-lf/language",
420+
"//daml-lf/transaction",
421+
"//daml-lf/transaction:transaction_proto_java",
422+
"//language-support/java/bindings:bindings-java",
423+
"//language-support/scala/bindings",
424+
"//language-support/scala/bindings-pekko",
425+
"//ledger-api/grpc-definitions:ledger_api_proto_scala",
426+
"//libs-scala/concurrent",
427+
"//libs-scala/contextualized-logging",
428+
"//libs-scala/executors",
429+
"//libs-scala/nameof",
430+
"//libs-scala/nonempty",
431+
"//observability/metrics",
432+
"//observability/tracing",
433+
"@maven//:ch_qos_logback_logback_classic",
434+
"@maven//:ch_qos_logback_logback_core",
435+
"@maven//:com_github_pathikrit_better_files_2_13",
436+
"@maven//:com_github_pureconfig_pureconfig_generic_2_13",
437+
"@maven//:com_google_crypto_tink_tink",
438+
"@maven//:com_google_guava_guava",
439+
"@maven//:com_google_protobuf_protobuf_java",
440+
"@maven//:com_lihaoyi_pprint_2_13",
441+
"@maven//:com_thesamet_scalapb_scalapb_runtime_2_13",
442+
"@maven//:com_typesafe_config",
443+
"@maven//:com_typesafe_scala_logging_scala_logging_2_13",
444+
"@maven//:com_typesafe_slick_slick_2_13",
445+
"@maven//:dev_optics_monocle_core_2_13",
446+
"@maven//:dev_optics_monocle_macro_2_13",
447+
"@maven//:io_circe_circe_core_2_13",
448+
"@maven//:io_grpc_grpc_api",
449+
"@maven//:io_grpc_grpc_netty",
450+
"@maven//:io_grpc_grpc_services",
451+
"@maven//:io_grpc_grpc_stub",
452+
"@maven//:io_netty_netty_handler",
453+
"@maven//:io_opentelemetry_opentelemetry_api",
454+
"@maven//:io_scalaland_chimney_2_13",
455+
"@maven//:junit_junit",
456+
"@maven//:net_logstash_logback_logstash_logback_encoder",
457+
"@maven//:org_apache_logging_log4j_log4j_core",
458+
"@maven//:org_apache_pekko_pekko_actor_2_13",
459+
"@maven//:org_bouncycastle_bcprov_jdk15on",
390460
"@maven//:org_scala_lang_scala_reflect",
391461
"@maven//:org_scalaz_scalaz_core_2_13",
392462
"@maven//:org_slf4j_slf4j_api",
@@ -438,6 +508,7 @@ scala_library(
438508
deps = [
439509
":pekko-stream-minus-patched-classes",
440510
":pekko-stream-patch",
511+
"//canton:community_base",
441512
"//canton:community_common",
442513
"//canton:community_ledger_ledger-common",
443514
"//canton:community_ledger_ledger-common_configuration_proto_java",
@@ -539,7 +610,7 @@ scala_library(
539610
unused_dependency_checker_mode = "error",
540611
deps = [
541612
":pekko-stream-minus-patched-classes",
542-
"//canton:community_common",
613+
"//canton:community_base",
543614
"//canton:community_ledger_ledger-api-core",
544615
"//canton:community_ledger_ledger-common",
545616
"//canton:community_util-logging",
@@ -602,7 +673,7 @@ proto_library(
602673
srcs = glob(["community/domain/src/main/protobuf/**/*.proto"]),
603674
strip_import_prefix = "community/domain/src/main/protobuf",
604675
deps = [
605-
"//canton:community_common_proto",
676+
"//canton:community_base_proto",
606677
"@com_google_protobuf//:duration_proto",
607678
"@com_google_protobuf//:empty_proto",
608679
"@com_google_protobuf//:timestamp_proto",
@@ -635,6 +706,7 @@ scala_library(
635706
deps = [
636707
":pekko-stream-minus-patched-classes",
637708
":pekko-stream-patch",
709+
"//canton:community_base",
638710
"//canton:community_common",
639711
"//canton:community_ledger_ledger-common",
640712
"//canton:community_lib_slick_slick-fork",
@@ -716,7 +788,7 @@ proto_library(
716788
srcs = glob(["community/participant/src/main/protobuf/**/*.proto"]),
717789
strip_import_prefix = "community/participant/src/main/protobuf",
718790
deps = [
719-
"//canton:community_common_proto",
791+
"//canton:community_base_proto",
720792
"@com_google_protobuf//:duration_proto",
721793
"@com_google_protobuf//:empty_proto",
722794
"@com_google_protobuf//:timestamp_proto",
@@ -810,6 +882,7 @@ scala_library(
810882
deps = [
811883
":community_participant_admin-workflows-with-vacuuming_java.jar",
812884
":pekko-stream-minus-patched-classes",
885+
"//canton:community_base",
813886
"//canton:community_common",
814887
"//canton:community_ledger_ledger-api-core",
815888
"//canton:community_ledger_ledger-common",
@@ -893,6 +966,7 @@ scala_library(
893966
unused_dependency_checker_mode = "error",
894967
deps = [
895968
":pekko-stream-minus-patched-classes",
969+
"//canton:community_base",
896970
"//canton:community_buildinfo",
897971
"//canton:community_common",
898972
"//canton:community_domain",
@@ -990,6 +1064,7 @@ scala_library(
9901064
deps = [
9911065
":pekko-stream-minus-patched-classes",
9921066
"//canton:community_app-base",
1067+
"//canton:community_base",
9931068
"//canton:community_buildinfo",
9941069
"//canton:community_common",
9951070
"//canton:community_domain",
@@ -1006,7 +1081,6 @@ scala_library(
10061081
"//libs-scala/jwt",
10071082
"//libs-scala/nonempty",
10081083
"//libs-scala/rs-grpc-bridge",
1009-
"//observability/metrics",
10101084
"@maven//:ch_qos_logback_logback_classic",
10111085
"@maven//:ch_qos_logback_logback_core",
10121086
"@maven//:com_github_pathikrit_better_files_2_13",

Diff for: sdk/canton/community/app-base/src/main/scala/com/digitalasset/canton/admin/api/client/commands/LedgerApiV2Commands.scala

+2
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ object LedgerApiV2Commands {
570570
parties: Set[LfPartyId],
571571
limit: PositiveInt,
572572
templateFilter: Seq[TemplateId] = Seq.empty,
573+
activeAtOffset: String = "",
573574
verbose: Boolean = true,
574575
timeout: FiniteDuration,
575576
includeCreatedEventBlob: Boolean = false,
@@ -595,6 +596,7 @@ object LedgerApiV2Commands {
595596
GetActiveContractsRequest(
596597
filter = Some(TransactionFilter(parties.map((_, filter)).toMap)),
597598
verbose = verbose,
599+
activeAtOffset = activeAtOffset,
598600
)
599601
)
600602
}

0 commit comments

Comments
 (0)