-
Notifications
You must be signed in to change notification settings - Fork 180
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
Include human-friendly error messages on EVM transaction events #6836
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6836 +/- ##
==========================================
- Coverage 41.18% 41.17% -0.01%
==========================================
Files 2109 2109
Lines 185660 185669 +9
==========================================
- Hits 76460 76450 -10
- Misses 102788 102805 +17
- Partials 6412 6414 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
2d8eb89
to
7fb6ff4
Compare
fvm/evm/events/events.go
Outdated
errorMessage := p.Result.ErrorMsg() | ||
if p.Result.ResultSummary().ErrorCode == types.ExecutionErrCodeExecutionReverted { | ||
reason, errUnpack := abi.UnpackRevert(p.Result.ReturnedData) | ||
if errUnpack == nil { | ||
errorMessage = fmt.Sprintf("%v: %v", gethVM.ErrExecutionReverted.Error(), reason) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this a method on types.Result
. Maybe call it ErrorMessageWithRevertReason
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea 👌 Updated in e682cd2 .
7fb6ff4
to
e682cd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Needs an HCU to be deployed, since error bodies are part of the proofs as far as I'm aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this require HCU?
@janezpodhostnik @zhangchiqing This change affects only the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the error message is not part of the execution result. so I think HCU is not necessary.
Closes #6770