-
Notifications
You must be signed in to change notification settings - Fork 21.4k
core/vm: add switches to select evm+ewasm interpreters #17687
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
Conversation
Is there a way to run tests with an external EVMC VM? E.g. |
EVMC supports also custom options. Can will add additional flag, e.g. |
cmd/utils/flags.go
Outdated
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 should be defined by a hard fork rule, not a CLI flag.
cmd/utils/flags.go
Outdated
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.
Please name these --vm.evm
and --vm.ewasm
. The defaults should be empty, which geth can interpret by running the built in VMs.
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.
Also add (default = built in implementation)
core/vm/interpreter.go
Outdated
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.
Whether ewasm is enabled or not is not a configuration value, it's a chain fork rule.
core/vm/interpreter.go
Outdated
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.
Please get rid of geth
and wagon
. Empty means built in, non empty means use something else.
params/config.go
Outdated
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.
Please use nil
. big.NewInt(0)
enables EWASM at block 0.
params/config.go
Outdated
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.
Please use nil
. big.NewInt(0)
enables EWASM at block 0.
params/config.go
Outdated
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.
Please use nil
. big.NewInt(0)
enables EWASM at block 0.
params/config.go
Outdated
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.
Please move this up after the rest of the fork definitions.
params/config.go
Outdated
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.
"Constantinople" -> "EWASM"
you can write those tests
I would say that's part of the EVMC pr: if you have |
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't wait to implement eWASM on mainnet 😂
core/vm/interpreter.go
Outdated
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.
Please remove "wagon" and "geth"
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.
ping
params/config.go
Outdated
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.
Lets keep the comment consistent with the other ones.
// EWASM switch block (nil = no fork, 0 = already activated)
cmd/utils/flags.go
Outdated
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.
External EWASM configuration (default = built in interpreter)
cmd/utils/flags.go
Outdated
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.
External EVM configuration (default = built in interpreter)
eth/config.go
Outdated
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.
Does this needs to be colon separated or can anything be passed after evmc:path:....
?
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.
anything can be passed
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.
You can use the same comments as for the flag.
External eWASM configuration
and External EVM configuration
I wouldn't mention the config string here yet, since it's not even implemented, so we don't know what it will be. We do know it won't be the one you listed though (no evmc
).
params/config.go
Outdated
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 use ewasm
instead of eWASM
as that is the current naming style?
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.
@axic is this the current or the definitive naming style? 😄
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.
Current, could change.
But there is agreement eWASM
is not the way to go :)
Interpreter initialization is left to the PRs implementing them. Options for external interpreters are passed after a colon in the `--vm.ewasm` and `--vm.evm` switches.
4e4c89b
to
0c84df5
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
Interpreter initialization is left to the PRs implementing them. Options for external interpreters are passed after a colon in the `--vm.ewasm` and `--vm.evm` switches.
} | ||
var ( | ||
vmConfig = vm.Config{EnablePreimageRecording: config.EnablePreimageRecording} | ||
vmConfig = vm.Config{ |
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.
Sorry, but you missed 64 other places where vm.Config{}
is created. I'm not even sure if the new incoming transactions are going to be executed with the selected VM.
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.
@chfast those other location correspond to tests and simulations and we want to use the native interpreter in them. Incoming transactions will be executed by the VM, if you don't believe us check it for yourself.
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 believe you. I just remember I had to change this in two places. Maybe it was about tests.
Interpreter initialization is left to the PRs implementing them.
There is a commented-out part that needs to be uncommented in order to initialize the proper interpreter when need be; for instance, in the case of ewasm and assuming that
--ewasm.interpreter
isevmc:path
then the code should be something like:and the
panic
should be removed.