Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
da-tanabe opened this issue Mar 25, 2021 · 0 comments
Open

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

da-tanabe opened this issue Mar 25, 2021 · 0 comments

Comments

@da-tanabe
Copy link
Contributor

da-tanabe commented Mar 25, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant