Commit 5644d6a8 authored by hezhengjun's avatar hezhengjun Committed by vipwzw

enable evm debug configurable

parent 5bbab3de
...@@ -282,6 +282,8 @@ useBalance=false ...@@ -282,6 +282,8 @@ useBalance=false
#免交易费模式联盟链允许的最大gas,该配置只对不收取交易费部署方式有效,其他部署方式下该配置不会产生作用 #免交易费模式联盟链允许的最大gas,该配置只对不收取交易费部署方式有效,其他部署方式下该配置不会产生作用
#当前最大为200万 #当前最大为200万
evmGasLimit=2000000 evmGasLimit=2000000
#evm内部调试输出,指令级的,默认关闭
evmDebugEnable=false
[metrics] [metrics]
#是否使能发送metrics数据的发送 #是否使能发送metrics数据的发送
......
...@@ -21,8 +21,6 @@ import ( ...@@ -21,8 +21,6 @@ import (
) )
var ( var (
evmDebug = true
// EvmAddress 本合约地址 // EvmAddress 本合约地址
EvmAddress = "" EvmAddress = ""
) )
...@@ -52,7 +50,10 @@ func GetName() string { ...@@ -52,7 +50,10 @@ func GetName() string {
func newEVMDriver() drivers.Driver { func newEVMDriver() drivers.Driver {
evm := NewEVMExecutor() evm := NewEVMExecutor()
evm.vmCfg.Debug = evmDebug cfg := evm.GetAPI().GetConfig()
conf := types.ConfSub(cfg, evmtypes.ExecutorName)
evmDebugEnable := conf.IsEnable("evmDebugEnable")
evm.vmCfg.Debug = evmDebugEnable
return evm return evm
} }
......
...@@ -118,11 +118,12 @@ func (evm *EVMExecutor) Query_EvmDebug(in *evmtypes.EvmDebugReq) (types.Message, ...@@ -118,11 +118,12 @@ func (evm *EVMExecutor) Query_EvmDebug(in *evmtypes.EvmDebugReq) (types.Message,
optype := in.Optype optype := in.Optype
if optype < 0 { if optype < 0 {
evmDebug = false evm.vmCfg.Debug = false
} else if optype > 0 { } else if optype > 0 {
evmDebug = true evm.vmCfg.Debug = true
} }
ret := &evmtypes.EvmDebugResp{DebugStatus: fmt.Sprintf("%v", evmDebug)}
ret := &evmtypes.EvmDebugResp{DebugStatus: fmt.Sprintf("%v", evm.vmCfg.Debug)}
return ret, nil return ret, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment