Skip to content
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

Translate fine-grained errors into coarse-grained, standardized errors #2689

Open
5 tasks
turbolent opened this issue Aug 2, 2023 · 3 comments
Open
5 tasks

Comments

@turbolent
Copy link
Member

turbolent commented Aug 2, 2023

Issue to be solved

On the Flow protocol side, ANs would like ENs to include errors into execution results, so they can serve requests without additional effort (e.g. re-execution of transaction(s)).

Currently, Cadence produces fine-grained errors, which are very detailed. Changes to the Cadence implementation commonly change errors (e.g. renaming of error type, change in error details, change of error message).

The nature of detailed/fine-grained and such changes increase the likelihood of execution forks, as an EN may produce a semantically equivalent error (e.g. type-checking of a contract failed), but the specific details of the error might be slightly different.

Suggested Solution

Tasks

Categorization of errors is tricky as we need to compromise between:

  • Providing as little information as possible, to reduce likelihood of execution forks, e.g. no source code
  • Providing as much information as possible for the errors to be useful.

Usefulness of error messages depends on the use-case / user persona:

  • For users of an application it might be sufficient to see in a block explorer that their transaction failed. A detailed error message is not necessary or might be incomprehensible
  • For a developer of an application it might be necessary to see as much details about a failed transaction to help them debug and fix the problem.

The process of categorization will therefore require lots of feedback from the broader community.

cc @peterargue

@SupunS
Copy link
Member

SupunS commented Aug 3, 2023

Just to make sure I understand correctly, the idea here is that:

  • Cadence will continue to report fine-grained errors
  • But they will be converted to more coarse-grained errors, before sending it out to AN/EN
  • These coarse-grained errors are not convertible back to fine-grained errors
    • But has the option to return the fine-grained error if needed (without the conversion)

Is that understanding correct?

@turbolent
Copy link
Member Author

@SupunS Yes, that matches the idea well 👍

There are of course some details to be worked out, but overall the hope is that this approach can cater to both needs (inclusion of errors in execution results, useful errors for development/debugging)

@j1010001
Copy link
Member

Access team blocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants