Allow the client to proposed blocks with `authenticated_owner = None`.
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.
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.
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.
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)