Repository navigation
π Canton .NET SDK: 0.8.2
TL;DR: every library now ships for both net10.0 and net11.0 β
, dotnet new canton-app starts a working Canton project from one command β
, and the REST and token-registry clients move to Refit 17 β
. A few collection members became read-only and some invalid options now fail at startup, so read the upgrade notes below before bumping.
π₯ Upgrading from 0.8.1
β οΈ Bump every package to0.8.2together, then regenerate your bindings. Delete the generated directory once so files from before the upgrade are cleared.
- π
Canton.Ledger.Rest,Canton.Ledger.Rest.ClientandSplice.Api.Token.Registry.ClientrequireRefit17.0.0. Code generated by Refit 16 does not link against Refit 17, so restore Refit 17 and rebuild; these packages cannot be mixed with Refit 16. If you build one of our interfaces yourself withRestService.For, callRestService.ForGeneratedwith the same settings, or referenceRefit.Reflection. Requests on the wire are unchanged. - π Collections handed out by the runtime and by generated records are read-only.
Set<T>.Elements,Map<TKey, TValue>.Entries,NonEmpty<T>.Tl,DamlRecord.Fields,CommandsSubmission.Commandsand the List, TextMap and Map fields of generated records now return read-only wrappers. A cast back toT[],HashSet<T>orDictionary<TKey, TValue>fails and a write through the interface throwsNotSupportedException: copy the collection instead. - π‘οΈ The token-registry client treats the registry as untrusted. It no longer follows redirects, bounds every call to 30 seconds and refuses a response body above 16 MiB. Override the timeout with
ConfigureHttpClienton the builder thatAddSpliceTokenRegistryClientsreturns. - β±οΈ Retry backoff is capped by
RetryOptions.MaxDelay, 30 seconds by default. A configuration whoseDelayis above 30 seconds must now setMaxDelaytoo, or options validation fails. - π¦ Timeouts that cannot work fail early.
LedgerClientOptions.Timeoutof zero or less fails options validation at startup on the gRPC client, as it already did on the JSON client. The snapshot reads throwArgumentOutOfRangeExceptionfor thetimeoutparameter at the call, for a negative value other thanTimeout.InfiniteTimeSpan.
Coming from before 0.8.1? See the [0.8.1] section of the CHANGELOG first.
β¨ Highlights
- π― Two targets,
net10.0andnet11.0: a project on either SDK restores the asset built for its own framework, and the Microsoft packages follow it, 10.0.x onnet10.0and 11.0.x onnet11.0. A machine with only the .NET 10 SDK still restores, generates bindings and builds. - π§°
dotnet new canton-app: the newCanton.ProjectTemplatespackage generates a Daml contract, a contracts project that builds it into C# bindings with no JDK, and a console app that uploads the DAR to a LocalNet participant, creates the contract and reads it back.dotnet new install Canton.ProjectTemplates dotnet new canton-app --name MyCantonApp
- π Bindings compile as C# 14 and C# 15: the generated code is proven to build under the language version of the .NET 10 SDK and of the .NET 11 SDK.
- π§© Collections of
Optionalgenerate compilable code: a List, TextMap or Map whose element is anOptionalnow produces bindings that build. - π§― Sharper failures in the codegen tools:
--rootemits output that compiles,--namespacerejects a value that is not a C# namespace before writing anything, and a malformed DAR is refused with anInvalidDataExceptioninstead of aNullReferenceException.
π Fixed
- π
ClientCredentialsProvideraccepts a token response whoseexpires_inis fractional or a numeric string, and logs only the OAuth error fields of a failed fetch instead of the raw body. - β
RecoverAsyncreports a completion-stream fault asCommitState.Unknown, where it reportedCommitState.NotCommitted, whose contract says a retry is safe. - π§Ύ
Canton.Ledger.AspNetCorekeeps a participant's error id out of the problem detail, the log and the span unless it is shaped like an error code.
The full list is in the CHANGELOG.
π¦ What's in the release
All 18 SDK packages ship on the single 0.8.2 version line, Canton.ProjectTemplates being the new one, with the dpm codegen-cs component at oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.8.2. The Splice.* bindings stay generated from Splice 0.10.0 and the Daml.Finance.* bindings from Daml Finance 2.10.0, each versioned after its DAR and built for net10.0, which a net11.0 project consumes as it is. The Daml SDK stays at 3.7.1 and the Ledger API stubs are pinned to Canton 3.7.4.