Skip to content

chore: ensure libevm new files wrap errors with appropriate context #91

Description

@qdm12

Rationale

We should be able to quickly find where an error is coming from, and have a minimal context on what failed. To do so we can:

  • use fmt.Errorf("doing this: %s", err) to wrap errors coming from 'below' layers
  • use fmt.Errorf("failed this: some details context") when creating an error, with necessary details

⚠️ careful geth is not checking the error directly with == instead of errors.Is otherwise it means we cannot add error context wrapping. In particular core/vm should be excluded.

Implementation

Check all *libevm* files as well as geth original source files that were modified for:

  • regex return.+err and add wrapping if appropriate
  • check other return statements in case we return the error directly without wrapping i.e. return f() where f returns an error

ℹ️ Note we obviously don't want to modify parts we did not add on top of geth and that we did not modify in geth original code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions