linera-protocol icon indicating copy to clipboard operation
linera-protocol copied to clipboard

Allow the client to proposed blocks with `authenticated_owner = None`.

Open MathieuDutSik opened this issue 8 months ago • 3 comments

There is no obstacle from having calls with authenticated_signer = None. However the block being proposed by the client always have a non-trivial authenticated_signer. This means that with the code, the only way to get an authenticated_signer = None is to make an unauthenticated call. This is suboptimal.

MathieuDutSik avatar Aug 23 '25 16:08 MathieuDutSik

We could add a field in the ApplicationDescription to declare whether the application needs authenticated signers (and callers?)

In practice, most blocks have at most one operation so they could adjust the parameter based on the application's requirement for that one operation.

And finally, we could move the authenticated_signer field from the block to Transaction::Operation.

ma2bd avatar Aug 23 '25 16:08 ma2bd

I do not think that we need to add it to a field of ApplicationDescription since it can be tested right away with

assert!(self.runtime.authenticated_signer().is_some());

For the authenticated_caller_id this is more complicated since authenticated_caller_id() = None can mean two things:

  • A user has called, not an application.
  • An application has called, but it was an unauthenticated call.

That is why I propose to have a function authenticated_caller() which returns a

enum Caller {
  User(AccountOwner),
  Contract(ApplicationId),
}

and with this we would have assert!(self.runtime.authenticated_caller().is_some()); if and only if the call is authenticated.

MathieuDutSik avatar Aug 23 '25 18:08 MathieuDutSik

Let's not digress please. My suggestion applies to problem stated in the title. (Client needs a way to set the field authenticated_signer when building blocks, before staging the execution)

ma2bd avatar Aug 24 '25 00:08 ma2bd