-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
Fix core errors in apply txs #1395
Fix core errors in apply txs #1395
Conversation
20723db
to
a2311d2
Compare
I think the errors should stay in package core. You can work around the import cycle by explicitly returning package vm
import "errors"
var OutOfGas = errors.New("out of gas") |
6b1f592
to
7c94dee
Compare
@@ -6,14 +6,18 @@ import ( | |||
"github.com/ethereum/go-ethereum/params" | |||
) | |||
|
|||
type OutOfGasError struct{} | |||
var OutOfGasError = &OutOfGasErr{Message: "Out of gas"} |
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.
Why can't this be errors.New("out of gas")
?
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.
For consistency with the other core errors, which makes use of struct type equality rather than variable equality. If we change this one we should change all, I think. @obscuren ?
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.
Only those that do not have variables
7c94dee
to
0f04af5
Compare
…ly_txs Fix core errors in apply txs
Description Improve reliability from the ethstats module The connectionWrapper was cherrypicked from go-ethereum upstream: ethereum@82a9e11 (ethereum#21404) Other changes Validator injecting its version to the proxy stats chunk Tested Manually in a local testnet Related issues Fixes ethereum#1395 Fixes ethereum#1397 Backwards compatibility Yes
Please merge this first: #1385This changes the logic in core to propagate all errors except explicitly matched ones, currently only the OutOfGas error. This error had broken type matching due to being defined in two places, so this PR also refactors core errors into its own subpackage so it can be used both in core and in core/vm.OOG error moved to core/vm on @fjl suggestion