ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

Revisit exit codes structure and semantics

Open raulk opened this issue 4 years ago • 1 comments

The current VM has a set of system exit codes, reserved (unused) exit codes, and a hardcoded set of actor codes to signal common conditions (e.g. not found, forbidden, illegal state, etc.)

Code 32 and above are actor-specific codes; that is, application-specific codes.

See package: https://github.com/filecoin-project/go-state-types/tree/master/exitcode

We have to figure out how the exit code situation may change with the FVM, and how exit codes will be reflected in the IDL (#29).

@expede has linked to EIP-1066, an attempt to normalise errors in Ethereum by introducing an enumerated set of status codes (with categorisation inspired by HTTP).


Original discussion here: https://github.com/filecoin-project/fvm-project/pull/4#discussion_r723748953

raulk avatar Oct 18 '21 12:10 raulk

EIP-1066, an attempt to normalise errors in Ethereum by introducing an enumerated set of status codes (with categorisation inspired by HTTP).

Yes exactly, like HTTP codes but aimed at the smart contract use case. Also hopefully improves on HTTP and make it more machine friendly by borrowing from other error code designs (e.g. evens and odds have meanings, high and low nibbles are meaningful).

Here's a better formatted (easier to read) site with some more resources that we put together for that back in the day: https://docs.fission.codes/fission-codes/

Hopefully that's helpful / has ideas that are useful for the FVM. I'd have to look more deeply at the problem space, but maybe it would work off the shelf, too

expede avatar Oct 18 '21 15:10 expede