Skip to content

Handle packages with future versions of Daml-LF more gracefully #190

@da-tanabe

Description

@da-tanabe

dazl can be pretty eager about trying to read packages that exist on a ledger in order to try to make sense of data that gets read from the Ledger API. However when those packages use a version of Daml-LF that isn't currently understood by dazl, the behavior is quite ill-defined.

Make sure that this is explicitly accounted for, and dazl degrades as gracefully as it can. It will almost certainly not be able to process data in those newer packages, but it should still be able to handle data for packages that it does have the ability to interpret.

The version of Daml-LF is neatly encoded in ArchivePayload.minor, so it's simply a matter of checking that against the version of Daml-LF that the Protobuf definitions were generated against, and throwing an exception instead of sending to ProtobufParser here:

archive_pb = parse_archive_payload(package_id, archive_bytes)
parser = ProtobufParser(package_id)
package = parser.parse_Package(archive_pb.daml_lf_1)
return Archive(package_id, package)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions