Repository navigation
v0.7.1: MSBuild codegen published, safer telemetry, sturdier test kit π§°
π 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 to0.7.1together, then regenerate your bindings. Delete the generated directory once so files from before the upgrade are cleared. Anything compiled against an earlierDaml.Runtimemust be rebuilt, or it throwsMissingMethodException.
- ποΈ
Daml.Runtime.Grpcis gone. ItsDamlValueConverternow lives insideCanton.Ledger.Grpc.Clientas an internal type. ReferenceCanton.Ledger.Grpc.Clientinstead: it converts values for you on every submission, query and subscription. If you called the converter directly, use the generatedCanton.Ledger.Grpcproto types and your own mapping. - π’
DamlNumeric.Scaleis removed, along with thescaleconstructor 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)andGetTypeParameterField<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_utilsgivesToken_utils,a.bgivesA_u002eb, and a part starting with a digit is escaped.a-bstill givesA.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). CallDeserializeRecord(json)orDeserializeRecord(json, limits). - π©
dar2intermediatetakes-v, not-V, for verbosity. A script that passed-V 2must pass-v 2. - π Telemetry is private by default. The
canton.user_idspan tag, ids in the admin log lines and exception messages are hidden unlessEmitPartyAndContractSpanTagsistrue. 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
timeoutis per attempt, as on the gRPC client, and defaults to 30 seconds through the newRestLedgerClientOptions.Timeout. With retries on, one call can take longer than a singletimeout; pass aCancellationTokenfor 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 throwJsonException. - π§ͺ 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
richtypesanddefaulttargettest packages also changed name and package id, andRichRecordgained fields. - π Smaller changes:
ExerciseCommand.ForInterface<TInterface>is removed (useExerciseCommand.For<TOwner>),VerbosityConsoleLoggerProvideris now internal, a blank contract id is refused at construction, andOpenTelemetry1.20.0 andRefit16.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 defaultStandalonemode needs no JDK;Dpmmode runsdpm codegen-csand pins the bundle by digest. Regenerating also deletes files the new run no longer emits. - π
ContractIdAs<T>(): turns the string contract id on a rawCreatedContract,ExercisedEventor tree event into a checkedContractId<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,InterfaceEventsandInterfaceLedgerEventsinCanton.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:TransactionResultandTransactionTreenow 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
IncludeDependenciesno 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, invalidRootFilterpatterns 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, andGetContractAsync<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.