Commit fc1057d4 authored by hezhengjun's avatar hezhengjun Committed by 33cn

add gas limit set for permission blockchain and fee free

parent 1a7f3fa7
...@@ -278,6 +278,11 @@ paraConsensusStopBlocks=30000 ...@@ -278,6 +278,11 @@ paraConsensusStopBlocks=30000
total="16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp" total="16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
useBalance=false useBalance=false
[exec.sub.evm]
#免交易费模式联盟链允许的最大gas,该配置只对不收取交易费部署方式有效,其他部署方式下该配置不会产生作用
#当前最大为200万
evmGasLimit=2000000
[metrics] [metrics]
#是否使能发送metrics数据的发送 #是否使能发送metrics数据的发送
enableMetrics=false enableMetrics=false
......
...@@ -213,6 +213,15 @@ func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *co ...@@ -213,6 +213,15 @@ func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *co
gasPrice := action.GasPrice gasPrice := action.GasPrice
if gasLimit == 0 { if gasLimit == 0 {
gasLimit = uint64(evm.GetTxFee(tx, index)) gasLimit = uint64(evm.GetTxFee(tx, index))
//如果未设置交易费,则尝试读取免交易费联盟链模式下的gas设置
if 0 == gasLimit {
cfg := evm.GetAPI().GetConfig()
conf := types.ConfSub(cfg, evmtypes.ExecutorName)
gasLimit = uint64(conf.GInt("evmGasLimit"))
if 0 == gasLimit {
panic("evmGasLimit is not configured for permission blockchain")
}
}
} }
if gasPrice == 0 { if gasPrice == 0 {
gasPrice = uint32(1) gasPrice = uint32(1)
......
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