Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Preview of EVMJIT integration #3410

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
deff301
core/vm: EVMJIT integration
chfast Dec 16, 2016
9391a91
core/vm: EVMJIT: improve callbacks
chfast Dec 22, 2016
4e677b3
core/vm: EVMJIT: fix some pending issues
chfast Dec 22, 2016
e27c5ef
Merge branch 'master' into evmjit
chfast Jan 20, 2017
284c013
core/vm: after merge
chfast Jan 20, 2017
2b5f3f2
core/vm: move vm_jit.go to evmjit.go
chfast Jan 22, 2017
fae7491
core/vm: Upgrade EVM-C API to v3
chfast Jan 25, 2017
c030867
core/vm/evmjit: Do not use full env context if not needed
chfast Jan 25, 2017
d151cf5
Merge branch 'master' into evmjit
chfast Jan 25, 2017
88d6123
evmjit: Update EVM-C callback functions
chfast Oct 24, 2017
bc9a71e
evmjit: Correctly release result
chfast Dec 11, 2017
db67881
evmjit: Add some debug logs
chfast Dec 11, 2017
dd082d4
evmjit: WIP implement calls
chfast Dec 11, 2017
07f1584
evmjit: Fix call result initialization
chfast Dec 12, 2017
10ee998
evmjit: Cleanup calls
chfast Dec 12, 2017
5fc5f53
evmjit: Release call outputs
chfast Dec 12, 2017
cfddfcf
evmjit: Comment out some logs
chfast Dec 12, 2017
f51cc8e
Merge remote-tracking branch 'upstream/master' into evmjit
chfast Dec 12, 2017
c732253
evmjit: Update after merge
chfast Dec 12, 2017
88aa0db
evmjit: Use EVMJIT instead of Interpreter
chfast Dec 12, 2017
6a0df90
evmjit: Add static call checks
chfast Dec 12, 2017
07379eb
evmjit: Add REVERT and Byzantium rev
chfast Dec 12, 2017
d0bbe11
evmjit: Implement STATICCALL
chfast Dec 12, 2017
4e82d06
evmjit: Fix REVERT
chfast Dec 14, 2017
8db11d7
ethstats: Add +EVMJIT
chfast Dec 14, 2017
216dcd1
Merge remote-tracking branch 'upstream/master' into evmjit
chfast Dec 19, 2017
1cf355c
evmjit: Remove snapshot arg
chfast Dec 19, 2017
dcc3a31
evmjit: Fix passing Go pointer
chfast Dec 19, 2017
ae9f13e
evmjit: Disable debug logs
chfast Dec 19, 2017
2cb5b8a
Merge remote-tracking branch 'upstream/master' into evmjit
chfast Jun 19, 2018
99caf5d
evmjit: Switch to aleth-interpreter
chfast Jun 19, 2018
d1439fd
cmd: Add --vm flag
chfast Jun 21, 2018
68eea63
evmc: Load VM dynamically
chfast Jun 21, 2018
a3a31bf
ethstats: Geth+EVMC
chfast Jun 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ var (
utils.TestnetFlag,
utils.RinkebyFlag,
utils.VMEnableDebugFlag,
utils.EVMCPathFlag,
utils.NetworkIdFlag,
utils.RPCCORSDomainFlag,
utils.RPCVirtualHostsFlag,
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ var AppHelpFlagGroups = []flagGroup{
Name: "VIRTUAL MACHINE",
Flags: []cli.Flag{
utils.VMEnableDebugFlag,
utils.EVMCPathFlag,
},
},
{
Expand Down
10 changes: 9 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ var (
Name: "vmdebug",
Usage: "Record information useful for VM and contract debugging",
}
EVMCPathFlag = cli.StringFlag{
Name: "vm",
Usage: "Path to EVMC compatible VM plugin",
}

// Logging and debug settings
EthStatsURLFlag = cli.StringFlag{
Name: "ethstats",
Expand Down Expand Up @@ -1070,6 +1075,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// TODO(fjl): force-enable this in --dev mode
cfg.EnablePreimageRecording = ctx.GlobalBool(VMEnableDebugFlag.Name)
}
if ctx.GlobalIsSet(EVMCPathFlag.Name) {
cfg.EVMCPath = ctx.GlobalString(EVMCPathFlag.Name)
}

// Override any default configs for hard coded networks.
switch {
Expand Down Expand Up @@ -1250,7 +1258,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheGCFlag.Name) {
cache.TrieNodeLimit = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheGCFlag.Name) / 100
}
vmcfg := vm.Config{EnablePreimageRecording: ctx.GlobalBool(VMEnableDebugFlag.Name)}
vmcfg := vm.Config{EnablePreimageRecording: ctx.GlobalBool(VMEnableDebugFlag.Name), EVMCPath: ctx.GlobalString(EVMCPathFlag.Name)}
chain, err = core.NewBlockChain(chainDb, cache, config, engine, vmcfg)
if err != nil {
Fatalf("Can't create BlockChain: %v", err)
Expand Down
6 changes: 3 additions & 3 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type EVM struct {
vmConfig Config
// global (to this context) ethereum virtual machine
// used throughout the execution of the tx.
interpreter *Interpreter
interpreter *EVMJIT
// abort is used to abort the EVM calling operations
// NOTE: must be set atomically
abort int32
Expand All @@ -122,7 +122,7 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon
chainRules: chainConfig.Rules(ctx.BlockNumber),
}

evm.interpreter = NewInterpreter(evm, vmConfig)
evm.interpreter = NewJit(evm, vmConfig)
return evm
}

Expand Down Expand Up @@ -400,4 +400,4 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
func (evm *EVM) ChainConfig() *params.ChainConfig { return evm.chainConfig }

// Interpreter returns the EVM interpreter
func (evm *EVM) Interpreter() *Interpreter { return evm.interpreter }
func (evm *EVM) Interpreter() *EVMJIT { return evm.interpreter }
Loading