Skip to content
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

all: remove noop vm config flags #23111

Merged
merged 3 commits into from
Jul 6, 2021
Merged

all: remove noop vm config flags #23111

merged 3 commits into from
Jul 6, 2021

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Jun 25, 2021

These PRs #17687, #18457, #18084 introduced the configuration for alternative interpreters (e.g. wasm or external evm-c based). They're no-op as of now and the feature PRs that use these config flags, namely #17954 and #16957 have been on hold for a long time and are not being actively pursued AFAIK.

If needed these flags can be re-introduced along with the actual logic at a later point.

I plan to look into whether the Interpreter interface implemented here https://github.com/ethereum/go-ethereum/pull/17093/files is useful without these external VMs and remove it otherwise.

@s1na s1na changed the title all: rm remove noop vm config flags all: remove noop vm config flags Jun 25, 2021
Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The only annoyance is that the Interpreter config fields ended up in the config file. So removing them will cause Geth to fail to load old configs :/

@karalabe
Copy link
Member

Fatal: /tmp/ccc, line 22: field 'EWASMInterpreter' is not defined in ethconfig.Config, see https://godoc.org/github.com/ethereum/go-ethereum/eth/ethconfig#Config for available fields

EWASMInterpreter string

// Type of the EVM interpreter ("" for default)
EVMInterpreter string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the config file will be rejected if we remove these, I think for now we should keep these and add a doc that they are deprecated/unused. We can remove them in a future PR if Felix changes the toml parser to accept invalid fields (or somehow more gracefully deprecate ones).

Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CanRun is no longer needed.

core/vm/evm.go Outdated
}
return interpreter.Run(contract, input, readOnly)
}
if !evm.interpreter.CanRun(contract.Code) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That CanRun function has been introduced to check that it was WASM code. If we no longer support multiple interpreters, then it should go as well, since in EVM, any bytecode is considered valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and deleted the Interpreter interface and the run func defined in evm.go too (in addition to CanRun). But happy to revert these changes and only remove CanRun

Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman
Copy link
Contributor

holiman commented Jun 30, 2021

#23118 is merged, please rebase and make use of it

@s1na s1na force-pushed the rm-ewasm branch 2 times, most recently from ae7124d to f6c13d7 Compare July 1, 2021 09:51
@s1na
Copy link
Contributor Author

s1na commented Jul 5, 2021

@holiman rebased and tried it on a synced node, no issue jumped out

Comment on lines +240 to +245
case "ethconfig.Config.EVMInterpreter":
return true
case "ethconfig.Config.EWASMInterpreter":
return true
default:
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is the 'namespace' they wind up in? I tried a geth --vm.ewasm=foo dumpconfig > foo.conf, and they wound up like this:

[Eth]
EWASMInterpreter = "foo"
EVMInterpreter = ""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the name is coming from reflect.Type.Name() of each config struct, which uses the packageName.typeName as its format. This is what I get when I use a similar config as your example:

WARN [07-06|09:28:46.630] Config field is deprecated and won't have an effect name=ethconfig.Config.EVMInterpreter

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@holiman holiman added this to the 1.10.5 milestone Jul 6, 2021
@holiman holiman merged commit 5441a8f into ethereum:master Jul 6, 2021
@s1na s1na deleted the rm-ewasm branch July 7, 2021 08:14
sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Jul 10, 2021
* all: rm external interpreter and ewasm config

* core/vm: rm Interpreter interface

* cmd/geth: deprecate interpreter config fields
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
* all: rm external interpreter and ewasm config

* core/vm: rm Interpreter interface

* cmd/geth: deprecate interpreter config fields
AusIV pushed a commit to NoteGio/go-ethereum that referenced this pull request Jan 18, 2022
This reverts commit 5441a8f.

# Conflicts:
#	cmd/utils/flags.go
#	core/vm/evm.go
#	eth/ethconfig/gen_config.go
#	eth/tracers/tracer_test.go
#	params/config.go
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 24, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 16, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 18, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 25, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 29, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 30, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 31, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 1, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 1, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 15, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Nov 15, 2024
JukLee0ira pushed a commit to JukLee0ira/XDPoSChain that referenced this pull request Nov 18, 2024
JukLee0ira pushed a commit to JukLee0ira/XDPoSChain that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants