You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be possible to get rid of async function calls at the leo level. This needs a comprehensive security analysis before starting a PoC. We need to know whether we're not losing essential expressivity with regards to how developers can order their async calls to be executed.
For example, the following code:
mapping account: address => u64;
record token {
owner: address,
amount: u64,
}
async transition mint_public(
public receiver: address,
public amount: u64,
) -> (token, Future) {
return (token {
owner: receiver,
amount,
}, update_state(receiver, amount));
}
async function update_state(
public receiver: address,
public amount: u64,
) {
let current_amount: u64 = Mapping::get_or_use(account, receiver, 0u64);
Mapping::set(account, receiver, current_amount + amount);
}
This would be very nice from a readability perspective and for lowering the barrier to entry for newer Leo devs. Two questions/concerns off the top of my head:
I'm assuming that the async/Future model would still remain in place in Aleo instructions. In that case, what would be the steps for assigning operations to the off-chain vs on-chain portions? Would the compiler only assign mapping operations to the on-chain section and leave the rest off-chain?
There might some issues with loss of granularity in terms of users being able to choose exactly which operations execute on-chain vs off-chain. I can't think of any immediate reasons why this would be important, but it's probably worth asking
🚀 Feature
It might be possible to get rid of async function calls at the leo level. This needs a comprehensive security analysis before starting a PoC. We need to know whether we're not losing essential expressivity with regards to how developers can order their async calls to be executed.
For example, the following code:
Could instead be represented as:
The text was updated successfully, but these errors were encountered: