Commit 63144cd7 authored by hezhengjun's avatar hezhengjun

remove ForkEVMRevertErrFormat

parent cbbecf96
...@@ -300,7 +300,6 @@ ForkEVMFrozen=0 ...@@ -300,7 +300,6 @@ ForkEVMFrozen=0
ForkEVMKVHash=0 ForkEVMKVHash=0
ForkEVMYoloV1=0 ForkEVMYoloV1=0
ForkEVMTxGroup=0 ForkEVMTxGroup=0
ForkEVMRevertErrFormat=0
[fork.sub.blackwhite] [fork.sub.blackwhite]
Enable=0 Enable=0
......
...@@ -115,20 +115,16 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int, ...@@ -115,20 +115,16 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int,
log.Debug(logMsg, "caller address", msg.From().String(), "contract address", contractAddrStr, "exec name", execName, "alias name", msg.Alias(), "usedGas", usedGas, "return data", common.Bytes2Hex(ret)) log.Debug(logMsg, "caller address", msg.From().String(), "contract address", contractAddrStr, "exec name", execName, "alias name", msg.Alias(), "usedGas", usedGas, "return data", common.Bytes2Hex(ret))
curVer := evm.mStateDB.GetLastSnapshot() curVer := evm.mStateDB.GetLastSnapshot()
if vmerr != nil { if vmerr != nil {
if cfg.IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEVMRevertErrFormat) { var visiableOut []byte
var visiableOut []byte for i := 0; i < len(ret); i++ {
for i := 0; i < len(ret); i++ { //显示[32,126]之间的字符
//显示[32,126]之间的字符 if ret[i] < 32 || ret[i] > 126 {
if ret[i] < 32 || ret[i] > 126 { continue
continue
}
visiableOut = append(visiableOut, ret[i])
} }
ret = visiableOut visiableOut = append(visiableOut, ret[i])
vmerr = errors.New(fmt.Sprintf("%s,detail: %s", vmerr.Error(), string(ret)))
} else {
vmerr = errors.New(fmt.Sprintf("%s,detail: %s", vmerr.Error(), string(ret)))
} }
ret = visiableOut
vmerr = errors.New(fmt.Sprintf("%s,detail: %s", vmerr.Error(), string(ret)))
log.Error("evm contract exec error", "error info", vmerr, "ret", string(ret)) log.Error("evm contract exec error", "error info", vmerr, "ret", string(ret))
return receipt, vmerr return receipt, vmerr
......
...@@ -42,8 +42,6 @@ func InitFork(cfg *types.Chain33Config) { ...@@ -42,8 +42,6 @@ func InitFork(cfg *types.Chain33Config) {
cfg.RegisterDappFork(ExecutorName, ForkEVMYoloV1, 9500000) cfg.RegisterDappFork(ExecutorName, ForkEVMYoloV1, 9500000)
// EVM合约支持交易组 // EVM合约支持交易组
cfg.RegisterDappFork(ExecutorName, ForkEVMTxGroup, 0) cfg.RegisterDappFork(ExecutorName, ForkEVMTxGroup, 0)
// EVM交易执行失败错误信息改进
cfg.RegisterDappFork(ExecutorName, ForkEVMRevertErrFormat, 0)
} }
//InitExecutor ... //InitExecutor ...
......
...@@ -46,8 +46,6 @@ const ( ...@@ -46,8 +46,6 @@ const (
ForkEVMYoloV1 = "ForkEVMYoloV1" ForkEVMYoloV1 = "ForkEVMYoloV1"
//ForkEVMTxGroup 交易组中的交易通过GAS检查 //ForkEVMTxGroup 交易组中的交易通过GAS检查
ForkEVMTxGroup = "ForkEVMTxGroup" ForkEVMTxGroup = "ForkEVMTxGroup"
//ForkEVMRevertErrFormat 执行失败错误信息格式
ForkEVMRevertErrFormat = "ForkEVMRevertErrFormat"
) )
var ( var (
......
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