Skip to content

v0.7.1: MSBuild codegen published, safer telemetry, sturdier test kit 🧰

Choose a tag to compare

@github-actions github-actions released this 23 Oct 17:49
· 13 commits to main since this release
Immutable release. Only release title and notes can be modified.
6d1c90a

πŸš€ Canton .NET SDK: 0.7.1

TL;DR: a hardening release on the 0.7 line βœ…: Daml.Codegen.CSharp.MSBuild is now published, so bindings generate at dotnet build time with no JDK needed βœ…, and telemetry hides party, user and contract ids unless you opt in βœ…. It also removes some API surface, so read the upgrade notes below before bumping.

πŸ’₯ Upgrading from 0.7.0

⚠️ Bump every package to 0.7.1 together, then regenerate your bindings. Delete the generated directory once so files from before the upgrade are cleared. Anything compiled against an earlier Daml.Runtime must be rebuilt, or it throws MissingMethodException.

  • πŸ—‘οΈ Daml.Runtime.Grpc is gone. Its DamlValueConverter now lives inside Canton.Ledger.Grpc.Client as an internal type. Reference Canton.Ledger.Grpc.Client instead: it converts values for you on every submission, query and subscription. If you called the converter directly, use the generated Canton.Ledger.Grpc proto types and your own mapping.
  • πŸ”’ DamlNumeric.Scale is removed, along with the scale constructor parameter. new DamlNumeric(1.5m) recompiles unchanged and behaves as before; new DamlNumeric(1.5m, 10) no longer compiles.
  • 🧬 Generated bindings must be regenerated. The hidden DamlRecord.GetOptionalField(string), GetOptionalChainField(string) and GetTypeParameterField<T>(string, ...) overloads are replaced by position-aware ones.
  • πŸ“¦ NuGet ids of generated projects changed. The id is now derived one hyphen-separated part at a time: token_utils gives Token_utils, a.b gives A_u002eb, and a part starting with a digit is escaped. a-b still gives A.B. Update any package reference that used a changed id. Generation now stops with an error if two packages would share an id.
  • πŸ”§ DeserializeRecord(string, JsonSerializerOptions?) is removed (it never read its options). Call DeserializeRecord(json) or DeserializeRecord(json, limits).
  • 🚩 dar2intermediate takes -v, not -V, for verbosity. A script that passed -V 2 must pass -v 2.
  • πŸ”­ Telemetry is private by default. The canton.user_id span tag, ids in the admin log lines and exception messages are hidden unless EmitPartyAndContractSpanTags is true. A dashboard or log query that matches on those ids finds nothing until you set it. The option now exists on the gRPC, JSON and PQS clients.
  • ⏱️ The JSON client's timeout is per attempt, as on the gRPC client, and defaults to 30 seconds through the new RestLedgerClientOptions.Timeout. With retries on, one call can take longer than a single timeout; pass a CancellationToken for a hard cap.
  • πŸ•’ Daml Time from JSON must be in the ledger's form: at most six fractional digits and a trailing Z. Other forms now throw JsonException.
  • πŸ§ͺ The conformance kit is stricter. Your seeded client may now fail stream checks it used to pass: seed an event after the first position, and keep a live subscription open until its token is cancelled. The richtypes and defaulttarget test packages also changed name and package id, and RichRecord gained fields.
  • πŸ“‰ Smaller changes: ExerciseCommand.ForInterface<TInterface> is removed (use ExerciseCommand.For<TOwner>), VerbosityConsoleLoggerProvider is now internal, a blank contract id is refused at construction, and OpenTelemetry 1.20.0 and Refit 16.4.0 are the new minimums.

Coming from before 0.7.0? See the [0.7.0] section of the CHANGELOG first.

✨ Highlights

  • πŸ—οΈ MSBuild codegen is published: add <DamlArchive Include="contracts.dar" /> and bindings generate at build time. The default Standalone mode needs no JDK; Dpm mode runs dpm codegen-cs and pins the bundle by digest. Regenerating also deletes files the new run no longer emits.
  • πŸ†” ContractIdAs<T>(): turns the string contract id on a raw CreatedContract, ExercisedEvent or tree event into a checked ContractId<T>, matching templates by package name so an upgraded package still resolves.
    var cid = created.ContractIdAs<Iou>();
  • 🧾 FakeLedgerClient.Submissions: every write the fake received, in call order, so a test can assert the right parties, payload and choice arguments went out.
  • 🏭 More testing factories: CompletionEvents, InterfaceEvents and InterfaceLedgerEvents in Canton.Ledger.Testing, so you stage streams without naming record constructors.
  • πŸ”’ Telemetry privacy defaults: ids and exception messages stay out of spans, logs and health checks unless you opt in.
  • πŸ’Έ PaidTrafficCost: TransactionResult and TransactionTree now report the confirmation traffic cost the submitting participant paid.

πŸ› Fixed

  • πŸ” The JSON client now retries an attempt that exceeds its timeout; before, one deadline covered the whole call and the retry never ran.
  • 🧱 Codegen with IncludeDependencies no longer also references a package whose types it already emits, so no type exists twice, and it now stops with a clear error on higher-kinded types, invalid RootFilter patterns and unsupported Daml-LF minors instead of emitting broken bindings.
  • πŸ“– A non-verbose gRPC GetContract (as Canton 3.5.18 answers) now decodes by position, and GetContractAsync<T> makes one call instead of two.

The full list is in the CHANGELOG.

πŸ“¦ What's in the release

Every package ships on the single 0.7.1 version line, including the newly published Daml.Codegen.CSharp.MSBuild.

πŸ”— Links