Skip to content

Commit

Permalink
LF: Freeze archive proto for LF 1.14 (#9912)
Browse files Browse the repository at this point in the history
CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
remyhaemmerle-da authored Jun 7, 2021
1 parent 15f9dfb commit db14536
Show file tree
Hide file tree
Showing 5 changed files with 1,692 additions and 4 deletions.
2 changes: 2 additions & 0 deletions daml-lf/archive/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ da_scala_test_suite(
":daml_lf_1.11_archive_proto_srcs",
":daml_lf_1.12_archive_proto_srcs",
":daml_lf_1.13_archive_proto_srcs",
":daml_lf_1.14_archive_proto_srcs",
":daml_lf_1.6_archive_proto_srcs",
":daml_lf_1.7_archive_proto_srcs",
":daml_lf_1.8_archive_proto_srcs",
Expand All @@ -146,6 +147,7 @@ da_scala_test_suite(
deps = [
":daml_lf_1.12_archive_proto_java",
":daml_lf_1.13_archive_proto_java",
":daml_lf_1.14_archive_proto_java",
":daml_lf_1.6_archive_proto_java",
":daml_lf_1.7_archive_proto_java",
":daml_lf_1.8_archive_proto_java",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";
package daml_lf_1_13;

option java_package = "com.daml.daml_lf_1_14";
option csharp_namespace = "Com.Daml.Daml_Lf_1_14.DamlLf";

import "com/daml/daml_lf_1_14/daml_lf_1.proto";

message ArchivePayload {
// this is number 3 for historical reasons -- we had
// Daml-LF v0 and v1 before we had minor versions.
string minor = 3;
reserved 9999; // for the removed "dev" major version

reserved 1; // was daml_lf_0

oneof Sum {
daml_lf_1.Package daml_lf_1 = 2;

// lf_2 = 4, lf_3 = 5, etc
}
}

enum HashFunction {
SHA256 = 0;
}

message Archive {
HashFunction hash_function = 1;

// deprecated field (bytes hash = 2), replaced by
// field 4.

// Must be an encoded ArchivePayload. We store it as `bytes` to
// simplify hashing and in future signing.
bytes payload = 3;
// The hash is simply the ascii7 lowercase hex-encoded hash of the bytes
// according to the hash_function. We store it here for convenience, code
// reading the Archive should verify that the hash is valid.
//
// Note that the hash is computed directly on the blob and not
// on the decoded structure. This means that servers implementing
// a Daml ledger need to store the blob as-is somewhere to be able
// to always offer proof that they have a Daml package matching
// the requested hash. We decided to go for this route rather than
// relying on a canonical encoding of the AST since such a scheme
// would be extremely hard (for example protobuf encoding is not
// canonical) to maintain and does not buy us much.
string hash = 4;

}
Loading

0 comments on commit db14536

Please sign in to comment.