-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function states can be corrupted when receiving non expected values #116
Comments
"sibling" (and any other) functions can just call each other normally. This is just for cross-contract communication |
@VictorTaelin Also, what do you think about passing the buffers as Braum trees? |
I now believe the best way to solve this issue is to normalize the argument of an As such, a monotype contract interface looks more sensible, but what type should we use? A single U120 number is too restrictive. A list of U120 numbers would require normalizing the entire thing, which isn't ideal, and it would still be inconvenient to use. Now, curiously, all contracts that we've written so far already use a quasi monotype: an "Action" sum type where each constructor has numbers. That is convenient, since it allows contracts to be organized as a series of methods. So, that's what we use. In a future, we could add some form of Note that it is still possible to corrupt a contract's state if it calls another contract that returns an unexpected type. Kindelia does not perform any kind of checking on the return of IO_CALL, since it assumes that a contract and all its dependencies were properly type-checked before deploying. That is on the developer's. The only reason we need this check for the argument of IO_CALL is that anyone, including users and contracts you do not trust, can call your contract. That is not the case of the return value of IO_CALL, since you're the one performing the IO, thus you must only call contracts you trust. In a future, we could also add some form of runtime type-checking to allow a contract to call an untrusted contract safely, but that isn't an important feature for now. |
moved to #208 |
related to #96
Possible solutions:
FWIW, I think we should allow "sibling" functions to communicate with raw data somehow.
cc @racs4 @developedby @VictorTaelin
The text was updated successfully, but these errors were encountered: