-
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
[Flow EVM] update error handling #5357
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5357 +/- ##
==========================================
- Coverage 55.95% 55.88% -0.08%
==========================================
Files 1023 1024 +1
Lines 98930 99160 +230
==========================================
+ Hits 55360 55413 +53
- Misses 39364 39510 +146
- Partials 4206 4237 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
// EVMExecutionError is a non-fatal error, returned when execution of | ||
// an evm transaction or direct call has failed. | ||
type EVMExecutionError struct { | ||
err error | ||
} |
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.
This was never used.
// ResultSummary summerizes the outcome of a EVM call or tx run | ||
type ResultSummary struct { | ||
Status Status | ||
ErrorCode ErrorCode | ||
GasConsumed uint64 | ||
} |
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.
This is what is returned for try methods.
|
||
"github.com/onflow/flow-go/fvm/evm/types" | ||
"github.com/onflow/flow-go/model/flow" | ||
) | ||
|
||
const ( | ||
BlockHashListCapacity = 256 | ||
BlockHashListCapacity = 16 |
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.
@janezpodhostnik I reduced this to 16 for now, until the new changes are ready.
fvm/evm/handler/handler_test.go
Outdated
// returns true if error passes the checks | ||
type checkError func(error) bool | ||
|
||
var isFatal = func(err error) bool { |
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.
I think we should keep the naming of failure and not mix the two otherwise it gets more confusing
|
||
var _ types.Backend = &WrappedEnvironment{} | ||
|
||
func (we *WrappedEnvironment) GetValue(owner, key []byte) ([]byte, error) { |
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.
these don't need to be pointer receivers.
closes #5225
This PR
Some context:
In the world of EVM, there are multiple possible outcomes for running a transaction
For us there are 4 cases:
run
, it reverts the outer Flow transaction, and fortryRun
it returns the status as Invalid, we also charge some computation.