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

Return the result of `execute_operation` as an event.

Open MathieuDutSik opened this issue 9 months ago • 1 comments

The running of the execute_operation in the Linera smart contract is returning a typed response Self::Response. Then this answer is serialized as a Vec<u8>.

That Vec<u8> is then dropped in runtime.rs at the following line:

                code.execute_operation(context, operation).map(|_| ())

It is easy to avoid the dropping of this result. But the question is how to access it. In Ethereum, when a transaction is submitted with eth_sendRawTransaction, the user receives a transaction_hash. That transaction hash can then access to the result of the operation by doing eth_getTransactionReceipt. In Ethereum, if one is interested in getting the result without the result being committed then we can use more directly eth_call.

But Linera is not like Ethereum. What we could do is to redirect the result of operation to events.

MathieuDutSik avatar Feb 12 '25 14:02 MathieuDutSik

I believe we decided against that in favor of #3378? @MathieuDutSik: Should this be closed?

afck avatar Mar 03 '25 11:03 afck

Ok, closed.

MathieuDutSik avatar May 16 '25 08:05 MathieuDutSik