-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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:
dazl-client/python/dazl/damlast/parse.py
Lines 30 to 35 in 598f371
| 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) |