kindelia / Kindelia

An efficient, secure cryptocomputer
https://kindelia.org/
603 stars 39 forks source link

Calling a fun that doesn't exist returns `Not IO term` #180

Open kings177 opened 2 years ago

kings177 commented 2 years ago

When deploying this:

run {
  ask x = (Call 'a10000000000' []);
  (Done x)
}

it returns:

ERROR: 'FUN:a10000000000:91fd' is not an IO term

since "a10000000000" is not an existent fun, shouldn't it just return something like:

ERROR: Couldn't find 'FUN:a10000000000'

cc @steinerkelvin

o-santi commented 2 years ago

When I added this error check, there was really no way to no if a name had been defined before or not (maybe checking if arity was defined for it? this would be clumsy). As I am adding statement indexes, this becomes much easier to fix.

steinerkelvin commented 2 years ago

The problem here is actually that when Funs do not reduce they just stay stuck (exactly as in the original HVM). So we would need to (a) make this a runtime error, or (b) make an error specific on call (ugly).

(a) would be something like RuntimeError::FunDoesNotReduce { name, arg_prts: [...] }