Skip to content

Draft: Less error-monad error more parametric results

Context

Eventually, we want to use less of the error type (from the error-monad) and more of specialised error types for different results. This is because:

  • The error-type being an extensible variant, some code gets somewhat complicated (error registration, encodings).
  • The error-type being an extensible variant, the type (u, error) result (a.k.a. u tzresult) is only informative in that it shows a function can fail, but it cannot show why.
  • The trace type needs to be made opaque for safety reasons (to avoid the possibility of empty traces) and to allow evolution of trace-related code.

This MR is a series of experiments with different parts of the code: replacing some error with a specialised error return type.

Status

  • changing all the error of stdlib and stdlib-unix to custom error types (reason: we can simplify the dependency graph of the low-level libraries)
  • changing the error types in p2p tests (reason: it explicitely matches on traces/errors)
  • changing the error types in micheline parsing (reason: it missuses the trace as a generic collection of error)

Manually testing the MR

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Raphaël Proust

Merge request reports