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
SuaveTransaction execution environment doesn't expose any properties of ConfidentialRequest that invoked it.
Rationale
Suppose you have a confidential method bid() which allows you to simulate payment tx; store it in confidential store etc.. The contract returns a callback to bidCallback(), a public non-confidential method. It has to be public and external to be called by the ConfidentialComputeRequest-sender in the SuaveTransaction.
Now, lets say you want to store the bid information and emit a lot, so you pass the data to the callback and store it during SuaveTransaction. But because the callback is public anybody can call it and change the storage or emit the log.
I tackled this by implementing ConfidentialControl using hash-based access control (implementation). But this requires unnecessary confidential initialisation of the contract and gas spent on guard checks.
Implementation
I'm not sure what implementation is the best for this. One way I believe it could work is to create a non-confidential precompile that returns the recipient field of the ConfidentialRequest used to invoke the SuaveTransaction. This way it is much easier and less gas intensive to create a guard that restricts access to the callback method.
The text was updated successfully, but these errors were encountered:
SuaveTransaction
execution environment doesn't expose any properties ofConfidentialRequest
that invoked it.Rationale
Suppose you have a confidential method
bid()
which allows you to simulate payment tx; store it in confidential store etc.. The contract returns a callback tobidCallback()
, a public non-confidential method. It has to be public and external to be called by theConfidentialComputeRequest
-sender in theSuaveTransaction
.Now, lets say you want to store the bid information and emit a lot, so you pass the data to the callback and store it during
SuaveTransaction
. But because the callback is public anybody can call it and change the storage or emit the log.I tackled this by implementing
ConfidentialControl
using hash-based access control (implementation). But this requires unnecessary confidential initialisation of the contract and gas spent on guard checks.Implementation
I'm not sure what implementation is the best for this. One way I believe it could work is to create a non-confidential precompile that returns the
recipient
field of theConfidentialRequest
used to invoke theSuaveTransaction
. This way it is much easier and less gas intensive to create a guard that restricts access to the callback method.The text was updated successfully, but these errors were encountered: