-
Notifications
You must be signed in to change notification settings - Fork 205
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
Investigate improvements to support interface subscriptions #14067
Comments
LF Interface library
It's not clear whether subscriptions will make it possible to universally treat an interface type as an alias or "pun" for its associated view type. For the purposes of these designs, I'm assuming that it will not. So interfaces will remain separate from the serializable type decls. An ast interface will include a reference to the identifier of the associated view type, a serializable type. We copy that to Assuming that LF will require that view types are records with no type parameters, we include utilities // EnvironmentInterface
def resolveInterfaceViewType(n: Ref.TypeConName): Option[Record.FWT]
// Interface
def resolveInterfaceViewType(n: Ref.QualifiedName): Option[Record.FWT]
// Interface companion
def interfaceViewResolver(findInterface: PartialFunction[PackageId, Interface])
: PartialFunction[Ref.TypeConName, Record.FWT] Will breakAnything downstream that depends on the structure of |
JSON APIIntroduce 3 subtypes for For the purposes of the DB cache, we will consider interface IDs exactly like template IDs, and their payload types to be exactly their interface view types. So the contracts table will continue to be partitioned by template ID: updates for a template ID won't affect an interface ID's partition, even if the same contract ID is present in both.
On the contract table, remove the In When assembling a transaction or ACS request, we always set Permitted multiqueries
When building Given the set of contract type IDs (template IDs or interface IDs) CTIDS = {ctid₁, ctid₂, …, ctidₙ} in a query, if there exist ctidⱼ, ctidₖ such that ctidⱼ ≠ ctidₖ and ctidⱼ is an interface ID, then the request will be rejected immediately. This is because this condition may require the response to account for the violation of one of these invariants, which would be incompatible with our current response format:
The caveat is that this forbids arbitrary multiplexing of query streams. Request/response formatThe above restriction means that the request and response format do not change; they merely gain additional semantics. In particular, In any of these new cases, if the interface ID does not have an associated interface view, the request will be rejected with HTTP 400. (NB: Transforming transaction streams to responsesThe above restriction squeezes the possible transaction streams into what can fit in current response formats. That will be done as follows for create events, with respect to the set of CTIDS from the multiquery.
Archive events in WS streams must also be transformed, because the
Will breakNothing. |
@S11001001 @ray-roestenburg-da I don't see anything here about what the API would look like neither for the HTTP JSON API Service nor for the Java bindings. Is there something that is blocking you here in some respect? Have you reached out to the Participant team to understand their current PoC and how they plan to move forward? |
Java bindings(Largely with respect to #14033 as of this writing.) In
Existing constructors should default these to empty maps, and be deprecated with a porting note, a version note, and fresh GitHub issue reference similar to #14039. Include proto to/from conversion changes; beware, this is not fully type-checked. Will breakUsers of transaction streams will likely encounter the deprecation warning on |
Two comments/suggestions on the JSON API changes:
|
Java bindings changes look very reasonable. |
@cocreature Thanks for pointing out the invalidation case. I will use this rule instead.
The simple format is one of the goals of applying these restrictions. "The payload type of an interface ID is its interface view" is a simple metaphor to extend existing query uses. The more general format, such as any gRPC-inspired one, penalizes the simple single-query use case to support full multiquery generality. To this point, the multiquery cases have imposed no additional complexity on single-query cases; it has always been possible to treat them as "one or list-of-n" functions as common in Python et al. The only artifact is From discussions elsewhere arose the suggestion from @garyverhaegen-da that we can implement the restricted form with the very nice-to-use "payload of interface ID is interface view" extension, and leave a more general multiquery result type to a new endpoint in a later release. This is the plan I currently have in mind. |
JavaScript bindings(This somewhat depends on #14134. Consider some form of interface contract ID from that proposal to be a prerequisite of this design.) An interface contract ID type for interface type I = Interface<"pkgid:mod:I"> & IV where Generate a
|
Interface subscription are currently being designed in this document.
They are an important piece of enabling upgradable applications using interfaces. As such, having them as part of the first stable release is important. We should understand how those could be implemented on top of our components, in particular:
Engage with the design document and report the changes that are deemed necessary to make our components support interface subscriptions.
The text was updated successfully, but these errors were encountered: